21.08.2016, 22:55
CMD all the time shows :"You need to login first before using any command." It is set to 1.... Under spawn, login dialog
pawn Код:
new Logged[ MAX_PLAYERS ];
YCMD:giverespect(playerid, params[],help)
{
if(Logged[playerid] == 1) SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
else if(PlayerInfo[playerid][pCMDT] > 0) SendClientMessage(playerid,0xFF0000FF,"Please wait before using this command again.");
else{
new id;
if(sscanf(params, "u", id)) SendClientMessage(playerid, 0xCC0000AA, "USAGE: /respect <playerid/partofname>");
else if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) SendClientMessage(playerid, -1, "ID not connected");
else if(playerid == id) SendClientMessage(playerid, -1, "You can't heal yourself.");
else if(!IsPlayerInRangeOfPlayer(playerid, id, 5)) SendClientMessage(playerid, -1, "You aren't close enough to the player.");
else{
new string[128];
PlayerInfo[playerid][pStreetRespect]++;
PlayerInfo[playerid][pCMDT] = 3600; // example 3600 - 1 hour
format(string, sizeof(string), " You have gived Street Respect to %s.", NORPN(id));
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), " Player %s has gived you Street Respect to you.", NORPN(playerid));
SendClientMessage(id, COLOR_WHITE, string);
}
}
return 1;
}