End command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: End command (
/showthread.php?tid=456785)
End command -
Pk93 - 07.08.2013
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
Re: End command -
iJumbo - 07.08.2013
Paste the errors please
Re: End command -
PT - 07.08.2013
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
Re: End command -
PT - 07.08.2013
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
Re: End command -
Pk93 - 07.08.2013
Thanks alot!