17.08.2013, 13:48
du herro everyone i need someboooody who can herp me with a probrem that i have todai, right now!
Is this cmd correct? The errors that I got is not related with the command! It's just random errors.
pawn Код:
dcmd_checkbelt(playerid, params[])
{
new tname[MAX_PLAYER_NAME];
new ID;
if(gTeam[playerid] != TEAM_COP)
{
SendClientMessage(playerid, -1, "you're not a cop");
return 1;
}
if(sscanf(params,"us[100]",ID))
{
SendClientMessage(playerid,COLOR_ERROR,"[USAGE] /checkbelt (Playername)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"[ERROR] The player ID you entered is not connected to the server.");
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
new Float:x, Float:y, Float:z;
GetPlayerPos(ID, x, y, z);
GetPlayerName(ID,tname,sizeof(tname));
if(PlayerToPoint(6.0, playerid, x, y, z) && Seatbelt[ID] == 1)
{
format(string, sizeof(string), "%s is wearing their seatbelt", PlayerName);
SendClientMessage(playerid, COLOR_GREEN, string);
return 1;
}
else if(PlayerToPoint(6.0, playerid, x, y, z) && Seatbelt[ID] == 0)
{
format(string, sizeof(string), "%s is not wearing their seatbelt", PlayerName);
SendClientMessage(playerid, COLOR_GREEN, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_CORAL, "You are not near that player");
return 1;
}
return 1;
}