SA-MP Forums Archive
Formatting player variable freaking? - 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: Formatting player variable freaking? (/showthread.php?tid=311088)



Formatting player variable freaking? - Rokzlive - 15.01.2012

Im trying to format the player variable, playerdata[playerid][info], to equal the string "Use /work to begin a route!" like this:
pawn Код:
format(playerdata[playerid][info],sizeof(playerdata[playerid][info]),"Use /work to begin a route!");
And this cause pawno to flip out.
Код:
C:\Users\Ingo\Desktop\samp03dsvr_R2_win32\gamemodes\ATL.pwn(525) : error 001: expected token: "]", but found "-identifier-"
C:\Users\Ingo\Desktop\samp03dsvr_R2_win32\gamemodes\ATL.pwn(525) : warning 215: expression has no effect
C:\Users\Ingo\Desktop\samp03dsvr_R2_win32\gamemodes\ATL.pwn(525) : error 001: expected token: ";", but found "]"
C:\Users\Ingo\Desktop\samp03dsvr_R2_win32\gamemodes\ATL.pwn(525) : error 029: invalid expression, assumed zero
C:\Users\Ingo\Desktop\samp03dsvr_R2_win32\gamemodes\ATL.pwn(525) : fatal error 107: too many error messages on one line

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


4 Errors.
What the heck did i do wrong, lol.


Re: Formatting player variable freaking? - Scenario - 15.01.2012

pawn Код:
sizeof(playerdata[playerid][info])
In my experience, you can't do this. I'm not sure why though!


Re: Formatting player variable freaking? - Rokzlive - 15.01.2012

Huh... thats odd. I guess ill just put in the numbers then xD


Re: Formatting player variable freaking? - coole210 - 15.01.2012

Just replace sizeof(playerdata[playerid][info]) with the size of the enum

Edit: late post