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



GetPlayerName help. - Tanush123 - 19.05.2013

pawn Код:
GetPlayerName(playerid,Nam,sizeof(Nam));
                    if(strlen(inputtext) == Nam) return SCM(playerid,red,"ERROR: You can't wire transfer to your self");
Код:
error 033: array must be indexed (variable "Nam")
(if(strlen(inputtext) == Nam) return SCM(playerid,red,"ERROR: You can't wire transfer to your self");)



Re : GetPlayerName help. - DaTa[X] - 19.05.2013

use strfind ?
pawn Код:
GetPlayerName(playerid,Nam,sizeof(Nam));
                    if(strfind(inputtext) == Nam) return SCM(playerid,red,"ERROR: You can't wire transfer to your self");



Re: GetPlayerName help. - Tanush123 - 19.05.2013

same line
Код:
C:\Users\Owner\SA-MP\gamemodes\xG.pwn(9774) : warning 202: number of arguments does not match definition
C:\Users\Owner\SA-MP\gamemodes\xG.pwn(9774) : error 033: array must be indexed (variable "Nam")



Re: GetPlayerName help. - Tee - 19.05.2013

Tanush, I haven't coded PAWN in months but I think this will work lol
pawn Код:
GetPlayerName(playerid,Nam,sizeof(Nam));
if(!strcmp(Nam,inputtext,false)) return SCM(playerid,red,"ERROR: You can't wire transfer to your self");



Re: GetPlayerName help. - Tanush123 - 19.05.2013

Thank you tee


Re: GetPlayerName help. - Tee - 19.05.2013

You're welcome I could've just posted it to you on Skype but if I did others with a similar problem wouldn't find out how you fixed it.