End command
#1

have problems to end this command i guess that is the problem,
i get 4 errors on the command under this one i guess its not ending like it should here is the script
Please if you have time to check it i would be glad for all help

Код:
CMD:cancel(playerid, params[])
{
	new id, string[128];
	if(!PlayerIsOn(id)) return NotConnectedMSG(playerid);
	if(sscanf(params, "s[128]", params))
	{
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cancel [option]");
		SendClientMessage(playerid, COLOR_GREY, "OPTIONS: steels");
		return 1;
	}
    if(!strcmp(params, "steels", true))
	{
	    if(BeenOfferedSteels[playerid])
	    {
			new playerb = BuySteelsFrom[playerid];
			if(!PlayerNearPlayer(3.0, playerid, id)) return NotNearPlayerMSG(playerid);
			format(string, sizeof(string), " You have cancelled %d's materials offer.", RPN(playerb));
			SendClientMessage(playerid, COLOR_GREY, string);
			format(string, sizeof(string), " %s has cancelled your materials offer.", RPN(playerid));
			SendClientMessage(playerb, COLOR_GREY, string);
			SellSteelsTo[playerb] = -1;
			BuySteelsFrom[playerid] = -1;
			BuySteelsAmount[playerid] = 0;
			BuySteelsPrice[playerid] = 0;
			BeenOfferedSteels[playerid] = 0;
		}
		else
		{
		    SendClientMessage(playerid, COLOR_GREY, "Nobody has offered to sell you materials.");
		    return 1;
    }
	return 1;
}
Errors
Код:
: error 029: invalid expression, assumed zero
: error 017: undefined symbol "cmd_steel"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line
Reply
#2

Paste the errors please
Reply
#3

pawn Код:
CMD:cancel(playerid, params[])
{
    new id, string[128];
    if(!PlayerIsOn(id)) return NotConnectedMSG(playerid);
    if(sscanf(params, "s[128]", params))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cancel [option]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: steels");
        return 1;
    }
    if(!strcmp(params, "steels", true))
    {
        if(BeenOfferedSteels[playerid])
        {
            new playerb = BuySteelsFrom[playerid];
            if(!PlayerNearPlayer(3.0, playerid, id)) return NotNearPlayerMSG(playerid);
            format(string, sizeof(string), " You have cancelled %d's materials offer.", RPN(playerb));
            SendClientMessage(playerid, COLOR_GREY, string);
            format(string, sizeof(string), " %s has cancelled your materials offer.", RPN(playerid));
            SendClientMessage(playerb, COLOR_GREY, string);
            SellSteelsTo[playerb] = -1;
            BuySteelsFrom[playerid] = -1;
            BuySteelsAmount[playerid] = 0;
            BuySteelsPrice[playerid] = 0;
            BeenOfferedSteels[playerid] = 0;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "Nobody has offered to sell you materials.");
            return 1;
        }
    }
    return 1;
}
you miss a bracet '{' i think is that the correct name
Reply
#4

pawn Код:
CMD:cancel(playerid, params[])
{
    new id, string[128];
    if(!PlayerIsOn(id)) return NotConnectedMSG(playerid);
    if(sscanf(params, "s[128]", params))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cancel [option]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: steels");
        return 1;
    }
    if(!strcmp(params, "steels", true))
    {
        if(BeenOfferedSteels[playerid])
        {
            new playerb = BuySteelsFrom[playerid];
            if(!PlayerNearPlayer(3.0, playerid, id)) return NotNearPlayerMSG(playerid);
            format(string, sizeof(string), " You have cancelled %d's materials offer.", RPN(playerb));
            SendClientMessage(playerid, COLOR_GREY, string);
            format(string, sizeof(string), " %s has cancelled your materials offer.", RPN(playerid));
            SendClientMessage(playerb, COLOR_GREY, string);
            SellSteelsTo[playerb] = -1;
            BuySteelsFrom[playerid] = -1;
            BuySteelsAmount[playerid] = 0;
            BuySteelsPrice[playerid] = 0;
            BeenOfferedSteels[playerid] = 0;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "Nobody has offered to sell you materials.");
            return 1;
        }
    }
    return 1;
}
you miss a bracet '{' i think is that the correct name
Reply
#5

Thanks alot!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)