SA-MP Forums Archive
everything wrong... :([Solved] - 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: everything wrong... :([Solved] (/showthread.php?tid=142603)



everything wrong... :([Solved] - AlbanianGuy - 19.04.2010

look i have made a variable or how ever it is called and it si
Код:
gUserTeam[MAX_PLAYERS]
and i use it for the teams to set the players team .. like this
Код:
GUserTeam[playerid] = Balla;
now my question is how to turn it from [playerid] = Balla to (playerid, Balla);
is it possible ? cuz i realy need it for something more important ...


Re: from [playerid] to (playerid, ... - xomka - 19.04.2010

something like this?
you put this into top of your script
pawn Код:
#define SetGUserTeam(%0,%1) GUserTeam[%0] = %1
then, you can replace GUserTeam[playerid] = Balla; with
pawn Код:
SetGUserTeam(playerid, Balla);



Re: from [playerid] to (playerid, ... - Kyosaur - 19.04.2010

Quote:
Originally Posted by AlbanianGuy
look i have made a variable or how ever it is called and it si
Код:
gUserTeam[MAX_PLAYERS]
and i use it for the teams to set the players team .. like this
Код:
GUserTeam[playerid] = Balla;
now my question is how to turn it from [playerid] = Balla to (playerid, Balla);
is it possible ? cuz i realy need it for something more important ...
What lol ?

I have no idea why you "need it like that", as in the end, if you make it a function, it'll be set up the SAME with the same variable. All your doing is adding more work.




Re: from [playerid] to (playerid, ... - AlbanianGuy - 20.04.2010

Quote:
Originally Posted by Kyosaur!!
Quote:
Originally Posted by AlbanianGuy
look i have made a variable or how ever it is called and it si
Код:
gUserTeam[MAX_PLAYERS]
and i use it for the teams to set the players team .. like this
Код:
GUserTeam[playerid] = Balla;
now my question is how to turn it from [playerid] = Balla to (playerid, Balla);
is it possible ? cuz i realy need it for something more important ...
What lol ?

I have no idea why you "need it like that", as in the end, if you make it a function, it'll be set up the SAME with the same variable. All your doing is adding more work.

i am trying to save hte player's team .. but when to make hte code if i do it like this
Код:
GTeamUser[playerid = (dUserINT(PlayerName(playerid)).("Balla"))
and hte code when he spawns to save the team
Код:
dUserSetINT(PlayerName2(playerid)).("Balla",GTeamUser[playerid]);
so in other words i want to save the team.. and when i do hte [playerid] = (duser.... it gives me a bunch of errors


Re: from [playerid] to (playerid, ... - cessil - 20.04.2010

why don't you just show us your save and load code


Re: from [playerid] to (playerid, ... - AlbanianGuy - 20.04.2010

Quote:
Originally Posted by cessil
why don't you just show us your save and load code
its right above .. the two last coded lines


Re: from [playerid] to (playerid, ... - cessil - 20.04.2010

oh well in that case...

Код:
GTeamUser[playerid = (dUserINT(PlayerName(playerid)).("Balla"))
variables are case sensitive and in the last posts the case has been changing so I'm not sure what it actually should be
but something like this

Код:
GTeamUser[playerid] = (dUserINT(PlayerName(playerid)).("Balla"))
paste the errors


Re: from [playerid] to (playerid, ... - AlbanianGuy - 20.04.2010

ok it works ... but there is something wrong with it .. look for example i choose the grove team .. then it spawns me with balla .. i tried different ways to save the team .. and hte same .. have i done something wrong ? a bracket or something that even if i choose anyteam it will give me balla .. why ? any suggestions ?


Re: from [playerid] to (playerid, ... - cessil - 20.04.2010

maybe change the "balla" to "gang" and have an id for each gang 1= grove 2= ballas ect.


Re: from [playerid] to (playerid, ... - Backwardsman97 - 20.04.2010

pawn Код:
//Use this to save their team
dUserSetINT(PlayerName(playerid)).("Team",GTeamUser[playerid]);

//And this to load it
GTeamUser[playerid] = dUserINT(PlayerName(playerid)).("Team");

//Then you could do
switch(GTeamUser[playerid])
{
   case 0:
   {

   }
   case 1:
   {

   }
   //etc.
}
Try that out. And you should have an id for each gang.