Need help with CMD..
#1

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], sendername[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, sendername, sizeof(sendername));
            if(sscanf(params, "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 string[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(string, sizeof(string), " You have gived Street Respect to %s.", GetPlayerName(id));//argoment doesnt match
                SendClientMessage(playerid, COLOR_WHITE, string);
                format(string, sizeof(string), " Player %s has gived you Street Respect to you.", GetPlayerName(playerid));//argoment doesnt match
                SendClientMessage(id, COLOR_WHITE, string);
            }
        }
        return 1;
    }
ERROR:
pawn Код:
(15218) : warning 213: tag mismatch
(15222) : warning 219: local variable "sendername" shadows a variable at a preceding level
(15226) : error 017: undefined symbol "params"
(15232) : warning 219: local variable "string" shadows a variable at a preceding level
(15235) : warning 202: number of arguments does not match definition
(15235) : warning 202: number of arguments does not match definition
(15237) : warning 202: number of arguments does not match definition
(15237) : warning 202: number of arguments does not match definition
With best regards Scrillex
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: 1 Guest(s)