hi ich hab ein kleines problem:
wenn ich ingame /adabuse 5000 id eingebe kann ich jede id eingeben egal was auch buchstaben aber nur ich bekomm immer die abuse.
hier der code:
Code
if(!strcmp(cmd, "/adabuse",true))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /adabuse 5000 [playerid/PartOfName]");
return 1;
}
moneys = strval(tmp);
if(moneys > 1 && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid,COLOR_GRAD1,"You are not authorized to use that command!");
return 1;
}
if(moneys > 5000)
{
SendClientMessage(playerid,COLOR_GRAD1, "Price 5000$");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD1,"USAGE: /adabuse 5000 [playerid/PartOfName]");
return 1;
}
GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
GetPlayerName(playerid, sendername,sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if(moneys > 0 && playermoney >= moneys)
{
ConsumingMoney[giveplayerid] = 1;
GivePlayerMoney(playerid, 0 - moneys);
format(string,sizeof(string),"AdmCmd: %s has been fined 5000$ by an Admin, reason: Advertisement-Abuse",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED,string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Wrong input!");
}
}
}
else
{
format(string,sizeof(string),"%d ist Nicht im Spiel", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1,string);
}
}
return 1;
}
Alles anzeigen
hoffe ihr könnt mir helfen