public doesn't work - Printable Version +- Las Venturas Playground (https://forum.sa-mp.nl) +-- Forum: Miscellaneous (https://forum.sa-mp.nl/forum-4.html) +--- Forum: Gaming (https://forum.sa-mp.nl/forum-27.html) +--- Thread: public doesn't work (/thread-8235.html) Pages:
1
2
|
Re: public doesn't work - MoToRoLa - 04-24-2008 (04-24-2008, 12:29 AM)Fry link Wrote: Re: public doesn't work - Jay - 04-24-2008 (04-24-2008, 12:24 AM)Fry link Wrote: Don't be too hasty to assumeEDIT: Sorry, mis-read. I thought you was looking at the variable for actually storing the name in, not the variable for the players id! Re: public doesn't work - Badeend - 04-24-2008 (04-24-2008, 12:06 PM)Jay link Wrote: Wrong. Those variables for getting the players name are fine, the players name has to be stored somewhere you know! What do you think what type of variable the first argument of GetPlayerName has to be? Re: public doesn't work - Smoke - 04-24-2008 Code: public set_mysql_loggedin_level(pname, level) First: with "new prname[16];" well 16 is not the correct size for names the correct size is 24 or you can use MAX_PLAYER_NAME Second: you havn't defined giveplayerid as anything so thats why GetPlayerName won't work. Third: you have functions in that code which we don't know if you have defined & we don't know what they do Fourth: You might want to add a loop or a playerid parameter so you can make GetPlayerName actually work properly You can try to replace the prname parameter to a playerid parameter, therefor if your trying to use a command like /setlevel [playerid] you can set giveplayerid to strval(tmp);. Also try changing GetPlayerName(giveplayerid,prname,sizeof(prname)); to GetPlayerName(playerid,prname,sizeof(prname)); remember to add a playerid parameter to your function and i think your using a string as strlogin? if yes you have to add it and its size so Code: new strlogin[96]; and i keep on spotting problems lol i just realized that you havb't defined level as anything Quote:What do you think what type of variable the first argument of GetPlayerName has to be? playerid xD Re: public doesn't work - Jay - 04-24-2008 (04-24-2008, 12:40 PM)Badeend link Wrote: What do you think what type of variable the first argument of GetPlayerName has to be? Yea, sorry mis-read. Didn't realise he was talking about the playerid parameter! Re: public doesn't work - Xanland - 04-24-2008 Thank you people, I changed a lot, looked at my commands. And realized that I did some wrong things. So I changed that. I now have this Code: 038: new strlogin[256]; But now I have got the following errors: Quote:E:\samp-server\8\gamemodes\xanland.pwn(155) : error 017: undefined symbol "playerid" On line 168 is this: Code: set_mysql_loggedin_level(sendername, 0); Code: set_mysql_loggedin_level(sendername, 1); sendername is made by GetPlayerName like in the command. 0 or 1 is the level it needs to be updated to. Re: public doesn't work - Smoke - 04-25-2008 You didn't listen to us lol, try adding a playerid parameter to your function, because GetPlayerName won't work because it's first argument is playerid don't use a name variable instead of a playerid, like you have in GetPlayerName |