16.08.2014, 07:38
pawn Код:
CMD:hownoob(playerid, params[])
{
new pname[MAX_PLAYER_NAME];
new noob = random(101);
new string[64];
new id; // the target
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "Invalid ID."); // You had IsPlayerConnected(playerid)
if(sscanf(params, "us[64]", id, string)) return SendClientMessage(playerid, RED, "Syntax: /hownoob (id)"); // You had "us[128]" yet you defined string as 64, and you forgot to include string after ID
// Change the rest of the stuff id = target, playerid = YOU
if(GetPVarInt(playerid,"HOWNOOB_TIMER")>GetTickCount())return SendClientMessage(playerid,0xFFFFFFFF,"Please Wait Before Being Noob Again!");
SetPVarInt(playerid,"HOWNOOB_TIMER",GetTickCount()+60000);
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "OMG! %s(%d) is %i Percent Noob!", pname, playerid, noob);
SendClientMessageToAll(PINK, string);
return 1;
}