06.07.2010, 14:16
TRY USE A DCMD
put
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
to defines udner include asamp
under onplayertext put
dcmd(wanted,6,cmdtext);
and at end put
dcmd_wanted(playerid, params[])
{
if(sapd[playerid] >= 1)
{
new id,wanted,string[128];
if(sscanf(params, "ud", id,wanted)) return SendClientMessage(playerid, RED, "USAGE: /WANTED [ID / NICK] [1/6]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "This player is offline");
if(wanted < 0 || wanted > 6) return SendClientMessage(playerid,RED,"Error: Enter a valid wanted level: 1/6");
format(string,sizeof(string),"%s has Set %s his Wanted Level to: %d!",playerid,id,wanted);
SendClientMessageToAll(YELLOW,string);
SetPlayerWantedLevel(id,wanted);
}
else if(sapd[playerid] >= 0)
{
SendClientMessage(playerid,YELLOW,"you cant use this command you are not sapd");
}
return 1;
}
not tested
put
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
to defines udner include asamp
under onplayertext put
dcmd(wanted,6,cmdtext);
and at end put
dcmd_wanted(playerid, params[])
{
if(sapd[playerid] >= 1)
{
new id,wanted,string[128];
if(sscanf(params, "ud", id,wanted)) return SendClientMessage(playerid, RED, "USAGE: /WANTED [ID / NICK] [1/6]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "This player is offline");
if(wanted < 0 || wanted > 6) return SendClientMessage(playerid,RED,"Error: Enter a valid wanted level: 1/6");
format(string,sizeof(string),"%s has Set %s his Wanted Level to: %d!",playerid,id,wanted);
SendClientMessageToAll(YELLOW,string);
SetPlayerWantedLevel(id,wanted);
}
else if(sapd[playerid] >= 0)
{
SendClientMessage(playerid,YELLOW,"you cant use this command you are not sapd");
}
return 1;
}
not tested