This repository has been archived by the owner on Feb 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
GetPlayerRadioStation
GtakillerIV edited this page Nov 15, 2014
·
3 revisions
Retrieves the player's current radio station ID
playerid
The player's id.
0 if the player is not in a vehicle
Else
Returns the station ID
CMD:getradio(playerid, params[])
{
//If the player has the SA-MP+ plugin installed
if(IsUsingSAMPP(playerid))
{
new targetid;
//If the entered parameters are incorrect, show him a message displaying the correct ones
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Correct usage: /getradio targetid");
if(IsPlayerInAnyVehicle(targetid))
{
new radioId = GetPlayerRadioStation(targetid);
//You now have the player's radio id stored in the variable radioId
}
else
{
SendClientMessage(playerid, -1, "The requested player is not in a vehicle");
}
}
else
{
SendClientMessage(playerid, -1, "You need the SA-MP+ plugin");
}
return 1;
}
See also
Callbacks