13.08.2009, 10:01
Since i've been having CPU usage problems with my gamemode. I'm re-writing a lot of it. i've removed lots of useless pieces of code, i probably wrote without even thinking.
Anyway im trying to re-write the commands using dcmd and sscanf.
This is an example command i've done, but its sending the message to ID 0 and not the intended id.
Anyway im trying to re-write the commands using dcmd and sscanf.
This is an example command i've done, but its sending the message to ID 0 and not the intended id.
pawn Код:
dcmd_caps(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1 && !PlayerTempMod[playerid] && !PlayerTempAdmin[playerid] && !IsPlayerAdmin(playerid)) return DenyMessage(playerid, 1);
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /caps [playerid]");
else if(giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "Invalid Player ID.");
else
{
SendClientMessage(giveplayerid, COLOR_YELLOW, "Please DO NOT use CAPs on this server...Thank You!");
PlayerPlaySound(giveplayerid, 1147, 0,0,0);
SendClientMessage(playerid, COLOR_PINK, "Message Sent!");
}
return 1;
}