Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Need help with this command

$
0
0
Hello!

I have a problem with /warn command. When i type id it put warn on id 0 not the id which i type
Code:

if(strcmp(cmd,"/awarn", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 6)
{
new targetid, reason[100];
if(IsPlayerConnected(targetid))
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
      SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Èçïîëçâàé:{FFFFFF} /awarn [playerid/èìå] [reason]");
      return 1;
    }
if(targetid != INVALID_PLAYER_ID)
{
if(PlayerInfo[targetid][pWarns] == 3)
{
new msg[300], tname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
GetPlayerName(targetid, tname, sizeof(tname));
GetPlayerName(playerid, name, sizeof(name));
format(msg, sizeof(msg), "SERVER: {FF0000}%s(ID: %d) {FF00FF}áåøå êèêíàò, Ïðè÷èíà: {FF0000}warning 3/3", tname, targetid);
SendClientMessageToAll(-1, msg);
format(string, sizeof(string), "%s áåøå êèêíàò îò ñúðâúðà. Ïðè÷èíà: warning 3/3", tname);
Kick(targetid);
}
if(PlayerInfo[targetid][pWarns] < 3)
{
new msg[300], tname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
PlayerInfo[targetid][pWarns]++;
GetPlayerName(targetid, tname, sizeof(tname));
GetPlayerName(playerid, name, sizeof(name));
format(msg, sizeof(msg), "ADMIN_WARN: {FF0000}%s {FF00FF}áåøå ïðåäóðåäåí, Reason: {FF0000}%s{FF00FF}, ïðåäóïðåæäàíèÿ: {FF0000}%d/3", tname, reason, PlayerInfo[targetid][pWarns]);
SendClientMessageToAll(-1, msg);
format(string, sizeof(string), "%s áåøå ïðåäóðåäåí îò %s, Reason: %s", tname, name, reason);
}
}
else return SendClientMessage(playerid, COLOR_RED, "ERROR: íÿìà òàêîâà ID");
}
}
else return SendClientMessage(playerid, COLOR_RED, "ERROR: Òè òðÿáâà äà ñè ïîíå àäìèí 6+.");
return 1;
}

Here is the command

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>