SA-MP Forums Archive
Errors which im unable to correct :\ - 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: Errors which im unable to correct :\ (/showthread.php?tid=130253)



Errors which im unable to correct :\ - pmk1 - 26.02.2010

Hey guys! im making my mode but i get errors for a /givecash command. But i got no clue on how to correct it. I looked on samp wiki but they're not clear for that.
Heres my errors:
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\gamemodes\pmkfunserver.pwn(547) : error 017: undefined symbol "string"
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\gamemodes\pmkfunserver.pwn(547) : error 017: undefined symbol "string"
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\gamemodes\pmkfunserver.pwn(547) : error 029: invalid expression, assumed zero
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\gamemodes\pmkfunserver.pwn(547) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


N here'S my script:
format(string, sizeof(string), "You've Given $%d To %s(player: %d).", giveplayer,giveplayerid, moneys);

But under this line, i've got a similar script line with the same begining ( format(string, sizeof(string), ) and it got no errors :\ What's wrong?

thanks



Re: Errors which im unable to correct :\ - Correlli - 26.02.2010

You need to define a string:
pawn Код:
new
    string[128];
Quote:
Originally Posted by pmk1
format(string, sizeof(string), "You've Given $%d To %s(player: %d).", giveplayer,giveplayerid, moneys);
And you have mixed integer and string type.
Correct:
pawn Код:
format(string, sizeof(string), "You've Given $%d To %s(player: %d).", moneys, giveplayer, giveplayerid);



Re: Errors which im unable to correct :\ - pmk1 - 26.02.2010

ok thanks, ill try this aand post back to see if it works :P


Re: Errors which im unable to correct :\ - pmk1 - 26.02.2010

hmm there's still a problem... The new include string, do i put it under #include 's or under
if(strcmp(cmd, "/givecash", true) == 0)
{
new
giveplayerid,
playermoney,
moneys,
giveplayer[MAX_PLAYER_NAME],
sendername[MAX_PLAYER_NAME],
tmp[32];
tmp = strtok(cmdtext, idx);

Because in each cases i get 1 errors and multiple warnings :\



Re: Errors which im unable to correct :\ - pmk1 - 26.02.2010

hmm forget it, i fixed it. i had put return 0; 2 times but i thoughtthey were separate because of a
//-------------------------------------------------- line that i made later xd thanks!