[SOLVED] to pvars - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] to pvars (
/showthread.php?tid=151792)
[SOLVED] to pvars -
russo666 - 31.05.2010
How can i do
new something[MAX_PLAYERS][MAX_PLAYERS];
with PVars?
I did alot of shit for more than 2 hours and this didn't work properly. I'm totaly bored and 'fucked up'. Can somebody help me please? Thanks in advance.
Edit: Solved. I did to PVars. One for each player.
Re: to pvars -
DarkPower - 31.05.2010
Example
pawn Code:
if(GetPVarInt(playerid, "Admin") == 5) SendClientMessage(playerid, 0xFFFFFFFF, "Your admin lvl is 5");
pawn Code:
new
_NameOfPlayer[MAX_PLAYER_NAME][2];
GetPlayerName(playerid, _NameOfPlayer[0], MAX_PLAYER_NAME);
GetPVarString(playerid, "name", _NameOfPlayer[1], MAX_PLAYER_NAME);
if(!strcmp(_NameOfPlayer[0], _NameOfPlayer[1], true)) SendClientMessage(playerid, 0xFFFFFFFF, "Your Text.");
Re: to pvars -
russo666 - 31.05.2010
Man thanks but now i can't get anything, if you can explain me in this case would be awesome!
pawn Code:
new something[MAX_PLAYERS][MAX_PLAYERS];
for(new i = 0 ; i < GetMaxPlayers(); i++)
{
if(something[i][playerid] == 1) continue;
if(something[i][playerid] == 0) do something.
}
Re: to pvars -
cAMo - 31.05.2010
Code:
SetPVarInt(playerid, "Money", 1000);
Code:
if(GetPVarInt(playerid, "Money") == 1000)
{
// You have $1000!
}
else
{
// You don't have $1000!
}
https://sampwiki.blast.hk/wiki/Per-player_variable_system
Your last post isn't using player variables.
Re: to pvars -
[HiC]TheKiller - 31.05.2010
Quote:
Originally Posted by russooooo
Man thanks but now i can't get anything, if you can explain me in this case would be awesome!
pawn Code:
new something[MAX_PLAYERS][MAX_PLAYERS];
for(new i = 0 ; i < GetMaxPlayers(); i++) { if(something[i][playerid] == 1) continue; if(something[i][playerid] == 0) do something. }
|
You cant really, why do you need that anyway?
Re: to pvars -
russo666 - 31.05.2010
Thanks to all! What i mean was what TheKiller said.
I need that for blocking players from speaking to me.
Edit: I tryied to do 2 pvars, 1 for the playerid one for the otherplayerid. Then i tryied to check both and used SendPlayerMessageToPlayer but i didn't work properly. Any idea how can i do that in another way (not enums)? I think the way i did it with pvars it should work but i can get it to run properly.
Edit 2: Solved. Did like i said before.