Scripting
#1

Hi guyz can someone Tutor me here i`m slow Learner
and I want to give Weapon depend on class
thank you for who help
Reply
#2

That class should be a variable for player?
You can do it like this
Код:
new Variable[MAX_PLAYERS]; // this should be your class

public OnPlayerSpawn(playerid)
{

if(Variable[playerid] == 1) // if this is true it is gonna to do the following
{
    GivePlayerWeapon(playerid,24,50) // this gives weapon, 24 is id of desert eagle, 50 is ammo which is goona be given to that player
}
else if(Variable[playerid] == 2) // and now the same thing but this time if Variable is set to 2 and you should put another weapon here
{
    GivePlayerWeapon(playerid, 25, 50)
}
return 1;
}
Reply
#3

Quote:
Originally Posted by TokicMajstor
Посмотреть сообщение
That class should be a variable for player?
You can do it like this
Код:
new Variable[MAX_PLAYERS]; // this should be your class

public OnPlayerSpawn(playerid)
{

if(Variable[playerid] == 1) // if this is true it is gonna to do the following
{
    GivePlayerWeapon(playerid,24,50) // this gives weapon, 24 is id of desert eagle, 50 is ammo which is goona be given to that player
}
else if(Variable[playerid] == 2) // and now the same thing but this time if Variable is set to 2 and you should put another weapon here
{
    GivePlayerWeapon(playerid, 25, 50)
}
return 1;
}
like this one
new HITMAN[MAX_PLAYERS]; // this should be your class

public OnPlayerSpawn(playerid)
{

if(HITMAN[playerid] == 1) // if this is true it is gonna to do the following
{
GivePlayerWeapon(playerid,24,50) // this gives weapon, 24 is id of desert eagle, 50 is ammo which is goona be given to that player
}
else if(Variable[playerid] == 2) // and now the same thing but this time if Variable is set to 2 and you should put another weapon here
{
GivePlayerWeapon(playerid, 25, 50)
}
return 1;
}
Reply
#4

Код:
else if(HITMAN[playerid] == 2)
But the variable Hitman doesn't mean player is a Hitman, it's its value that count.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)