01.07.2017, 11:05
I wanted to try out the OOP idea and create a scratch gamemode for samp.
Basically I got
Playerdata has pInfo and such, however, I got this function to be able to access the variables from anywhere in the script
So the problem is, this function successfully returns the password of a player "inside" playerdata itself, however, when trying to use it in dialogs.pwn it turns into "1sers/-player name-.ini"
Dialogs.pwn code
First printf shows the above
Second printf shows the same as tmpPass
Also, any ideas if I can better optimize it?
EDIT: tried using
but shows an error
Basically I got
Код:
/* GAMEMODE FILES */ #include "minigames/playerdata.pwn" #include "minigames/dialogs.pwn"
Код:
function GetPlayerInfo(playerid, pInfo:var) { return PlayerInfo[playerid][var]; }
Dialogs.pwn code
Код:
new tmpPass[60]; format(tmpPass,sizeof(tmpPass), "%s", GetPlayerInfo(playerid,pPass)); printf("%s general tmppass", tmpPass); printf("%s geenral getplayerinfo", GetPlayerInfo(playerid,pPass));
Second printf shows the same as tmpPass
Also, any ideas if I can better optimize it?
EDIT: tried using
Код:
if(strcmp(GetPlayerInfo(playerid,pPass), inputtext) == 0)
Код:
dialogs.pwn(41) : error 035: argument type mismatch (argument 1)