everything wrong... :([Solved]
#1

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

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

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.

Reply
#4

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

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

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

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
Reply
#8

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)