[SOLVED] to pvars
#1

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.
Reply
#2

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.");
Reply
#3

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.
}
Reply
#4

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.
Reply
#5

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?
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)