SA-MP Forums Archive
Error - 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: Error (/showthread.php?tid=647279)



Error - Imbalo - 02.01.2018

the code is :
INI_WriteString(File,"Name",GetPlayerName(playerid , playername, sizeof(playername)));

i got this error:
C:\Users\10\Desktop\mamamssvf\gamemodes\test.pwn(1 32) : error 035: argument type mismatch (argument 3)

can you help me ?


Re: Error - RogueDrifter - 02.01.2018

That's not how getplayername works,
replace with this and notice the difference.
PHP Code:
GetPlayerName(playerid playernamesizeof(playername));
INI_WriteString(File,"Name",playername); 



Re: Error - Imbalo - 02.01.2018

it works.


Re: Error - RogueDrifter - 02.01.2018

Quote:
Originally Posted by Imbalo
View Post
it works.
Yeah next time when you use getplayername declare the variable then save the player's name in that variable through getplayername then use that variable in the functions you're scripting don't use the actual getplayername function into another function.