27.07.2013, 11:01
For example, here's one of the basic commands which sometimes does not work, even with the player 100% IS Connected to the server. It takes the name string, runs it through sscanf with the parameter of Playername/ID, and sets it to giveplayerid.
If I had a !IsPlayerConnected(giveplayerid) in there, it would say Player is not connected. When they DEFINITELY are connected to the server. Without this line, which was my attempt to fix, it just says UNKNOWN COMMAND instead.
If I had a !IsPlayerConnected(giveplayerid) in there, it would say Player is not connected. When they DEFINITELY are connected to the server. Without this line, which was my attempt to fix, it just says UNKNOWN COMMAND instead.
pawn Код:
CMD:id(playerid, params[])
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /id [playerid/PartOfName]");
else
{
format(string, sizeof(string), "(ID: %d) - (Name: %s) - (Level: %d) - (Ping: %d)", giveplayerid, GetPlayerNameEx(giveplayerid), PlayerInfo[giveplayerid][pLevel], GetPlayerPing(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
return 1;
}

