Well, since im bored and i wanna help choobs out there who have almost no idea how to do weapon threads, here it goes.
First, we gonna near a name for your thread, lets just call it doWeapon
Code:
doWeapon()
{
self endon("disconnect")
self endon("death")
}
First, u always need self endon and take all weapons, or else u will get snytax error
Now, lets get started on giving weapon. Lets say i wanna give the person a RPG, so what i do is first i put the give weapon code, then i just fill in the blanks
Code:
self giveWeapon("<weapon>", 0, false );// You always need ; after every line, and also don forget quotes when u put weapon
self giveWeapon("rpg_mp", 0, false );
Ok, so now in our thread we are going to need our code, so lets add it:
Code:
doWeapon()
{
self endon("disconnect");
self endon("death");
self takeAllWeapons();
self giveWeapon("rpg_mp", 0, false );
}
You just gave an RPG to the player! but wait...where does this thread goes??? well, on ur _rank.gsc, if you scroll down u will see on Player Spawned thread...you will see this code here:
Code:
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self thread doWeapon();
}
}
thats it, ur now done with giving a weapon to someone, Congrats!!!
Thanks me if this was helpful
and this is for CHOOBS, not for people who already know .gsc modding