SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 31/05/2010, 09:09 PM   #1
russo666
High-roller
 
Join Date: Sep 2007
Posts: 1,007
Reputation: 5
Default [SOLVED] to pvars

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.
russo666 is offline  
Old 31/05/2010, 09:12 PM   #2
DarkPower
Gangsta
 
DarkPower's Avatar
 
Join Date: Feb 2010
Posts: 645
Reputation: 7
Default Re: to pvars

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.");
DarkPower is offline  
Old 31/05/2010, 09:18 PM   #3
russo666
High-roller
 
Join Date: Sep 2007
Posts: 1,007
Reputation: 5
Default Re: to pvars

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.
}
russo666 is offline  
Old 31/05/2010, 09:22 PM   #4
cAMo
Big Clucker
 
Join Date: Dec 2007
Posts: 134
Reputation: 0
Default Re: to pvars

Code:
SetPVarInt(playerid, "Money", 1000);
Code:
if(GetPVarInt(playerid, "Money") == 1000)
{
   // You have $1000!
}
else
{
   // You don't have $1000!
}
http://wiki.sa-mp.com/wiki/Per-player_variable_system

Your last post isn't using player variables.
cAMo is offline  
Old 31/05/2010, 09:26 PM   #5
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 2,629
Reputation: 410
Default Re: to pvars

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?
__________________
[HiC]TheKiller is offline  
Old 31/05/2010, 09:28 PM   #6
russo666
High-roller
 
Join Date: Sep 2007
Posts: 1,007
Reputation: 5
Default Re: to pvars

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.
russo666 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pvars Steven82 Help Archive 0 26/05/2010 08:52 PM
Looping Pvars Dark_Kostas Help Archive 4 06/04/2010 07:18 AM
PVars Question(s) XGh0stz Help Archive 0 02/04/2010 08:08 PM
Pvars question? Torran Help Archive 4 26/03/2010 05:53 PM
Pvars... biltong Help Archive 8 26/03/2010 01:31 PM


All times are GMT. The time now is 01:36 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.