[HELP]Charity 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Charity command ! (
/showthread.php?tid=197208)
[HELP]Charity command ! -
[Aka]Dragonu - 08.12.2010
Hi ! I made /charity command that when you do it some money will be withdrawn from your character , and donated . But i get these erorrs :
Command :
pawn Код:
if(strcmp(cmd, "/charity", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /charity [amount]");
return 1;
}
giveplayerid = strval(tmp)
if(giveplayerid <= playermoney && giveplayerid >= 0);
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Thank you for you donation of, $%d.",sendername,giveplayerid);
SendClientMessage(playerid, COLOR_GREEN, string);
GivePlayerMoney(playerid, -giveplayerid);
PayLog(string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "That is not enough.");
}
return 1;
}
Errors :
pawn Код:
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(11523) : error 001: expected token: ";", but found "if"
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(11523) : error 036: empty statement
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(11531) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
Lines: 11523 :
pawn Код:
if(giveplayerid <= playermoney && giveplayerid >= 0);
11531 :
Help please !
Re: [HELP]Charity command ! -
Pooh7 - 08.12.2010
pawn Код:
if(strcmp(cmd, "/charity", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /charity [amount]");
return 1;
}
giveplayerid = strval(tmp);
if(giveplayerid <= playermoney && giveplayerid >= 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s Thank you for you donation of, $%d.",sendername,giveplayerid);
SendClientMessage(playerid, COLOR_GREEN, string);
GivePlayerMoney(playerid, -giveplayerid);
PayLog(string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "That is not enough.");
}
return 1;
}
Re: [HELP]Charity command ! -
[Aka]Dragonu - 08.12.2010
Oh ok . I solved it . Thank's a lot !