01.05.2014, 00:26
PHP код:
CMD:cb(playerid, params[]) return cmd_checkbelt(playerid, params);
CMD:checkbelt(playerid, params[])
{
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /checkbelt [playerid]");
if(GetPlayerState(giveplayerid) == PLAYER_STATE_ONFOOT)
{
SendClientMessageEx(playerid,COLOR_GREY,"That player is not in any vehicle!");
return 1;
}
if (ProxDetectorS(9.0, playerid, giveplayerid))
{
new string[128];
new stext[4];
if(Seatbelt[giveplayerid] == 0) { stext = "off"; }
else { stext = "on"; }
if(IsABike(GetPlayerVehicleID(playerid)))
{
format(string, sizeof(string), "%s's helmet is currently %s." , GetPlayerNameEx(giveplayerid) , stext);
SendClientMessageEx(playerid,COLOR_WHITE,string);
format(string, sizeof(string), "* %s looks at %s, checking to see if they are wearing a helmet.", GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "%s's seat belt is currently %s." , GetPlayerNameEx(giveplayerid) , stext);
SendClientMessageEx(playerid,COLOR_WHITE,string);
format(string, sizeof(string), "* %s peers through the window at %s, checking to see if they are wearing a seatbelt.", GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else { SendClientMessageEx(playerid, COLOR_GREY, "You are not around that player!"); }
return 1;
}
