Need help with CMD..
#3

when I type /streetrespect it gives me: ID NOT CONNECTED!

pawn Код:
if(strcmp(cmd,"/streetrespect",true) == 0)
    {
        if(gPlayerLogged[playerid] == 0) SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");//First error
        else if(PlayerInfo[playerid][pCMDT] > 0) SendClientMessage(playerid,0xFF0000FF,"Please wait before using this command again.");
        else
        {
            new id;
            new targetname[MAX_PLAYER_NAME], sendername2[MAX_PLAYER_NAME];//warning 219: local variable "sendername" shadows a variable at a preceding level
            id = ReturnUser(tmp);
            GetPlayerName(id, targetname, sizeof(targetname));
            GetPlayerName(playerid, sendername2, sizeof(sendername2));
            if(sscanf(cmd, "u", id)) SendClientMessage(playerid, 0xCC0000AA, "USAGE: /respect <playerid/partofname>");//error 017: undefined symbol "params"
            else if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) SendClientMessage(playerid, -1, "ID not connected");
            else if(playerid == id) SendClientMessage(playerid, -1, "You can't give Street Respect to yourself.");
            else if(!IsPlayerInRangeOfPlayer(playerid, id, 5)) SendClientMessage(playerid, -1, "You aren't close enough to the player.");
            else
            {
                new string2[128];//warning 219: local variable "string" shadows a variable at a preceding level
                PlayerInfo[playerid][StreetRespect]++;
                PlayerInfo[playerid][pCMDT] = 3600; // example 3600 - 1 hour
                format(string2, sizeof(string2), " You have gived Street Respect to %s.", targetname);//argoment doesnt match
                SendClientMessage(playerid, COLOR_WHITE, string2);
                format(string2, sizeof(string2), " Player %s has gived you Street Respect to you.", sendername2);//argoment doesnt match
                SendClientMessage(id, COLOR_WHITE, string2);
            }
        }
        return 1;
    }
Thank you for your help.
Reply


Messages In This Thread
Need help with CMD.. - by Scrillex - 24.02.2015, 08:45
Re: Need help with CMD.. - by Golf - 24.02.2015, 08:51
Re: Need help with CMD.. - by Scrillex - 24.02.2015, 09:23
Re: Need help with CMD.. - by Golf - 24.02.2015, 09:59
Re: Need help with CMD.. - by Gammix - 24.02.2015, 10:32
Re: Need help with CMD.. - by Golf - 24.02.2015, 10:38
Re: Need help with CMD.. - by Gammix - 24.02.2015, 12:17

Forum Jump:


Users browsing this thread: 2 Guest(s)