SA-MP Forums Archive
Variable with letters and numbers - 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: Variable with letters and numbers (/showthread.php?tid=577996)



Variable with letters and numbers - JoshNudock - 15.06.2015

Hello, I have a problem, I use letters and numbers, most can not, and has error, the variable is used to save the e-mail a player ..

PHP код:
enum pInfo
{
    
pFuncao[56]
}
format(var,32,"Email=%s\n",PlayerInfo[playerid][pEmail]);fwrite(hFile, var); 
onplayerconect:

PHP код:
strmid(PlayerInfo[playerid][pEmail], "empty"0strlen("empty"), 255); 
Variable to be defined:
PHP код:
if (dialogid == DIALOG_EMAIL_1)
    {
        if (
response)
        {
                
PlayerInfo[playerid][pEmail] = inputtext//error
        
}
   } 
Код:
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(22440) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Variable with letters and numbers - Konstantinos - 15.06.2015

pawn Код:
#if !defined strcpy
    #define strcpy(%0,%1) strcat((%0[0] = EOS, %0), %1)
#endif
usage:
Код:
strcpy(PlayerInfo[playerid][pEmail], inputtext, /* SIZE OF "pEmail" HERE */);
and modify the size on the red text.


Re : Re: Variable with letters and numbers - Dutheil - 15.06.2015

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
#if !defined strcpy
    #define strcpy(%0,%1) strcat((%0[0] = EOS, %0), %1)
#endif
usage:
Код:
strcpy(PlayerInfo[playerid][pEmail], inputtext, /* SIZE OF "pEmail" HERE */);
and modify the size on the red text.
Or use strunpack, it's faster and do the same thing :3


Re: Re : Re: Variable with letters and numbers - Vince - 15.06.2015

Quote:
Originally Posted by Dutheil
Посмотреть сообщение
Or use strunpack, it's faster and do the same thing :3
Proof? Benchmarks?