Weapon on spawn - 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)
+--- Thread: Weapon on spawn (
/showthread.php?tid=635860)
Weapon on spawn -
1fret - 15.06.2017
How can i give players weapon depending on their team and which skin they choose for the team , as simple as that , i think i have a way but i haven't scripted it because it will be lot of repeating etc and i want to hear or even see example's of how you would would go about doing this code.
For Example: Skin 230 is a vip skin so if i choose skin 230 when i spawn i will get sniper/desert/molotov etc.. But that will only be assigned to skin 230 and if the player is on VIP team..
Example 2: Forget about the skin check. But suppose a player is on VIP Team , VIP team consist of 2 skins i want to assign weapons depending on the one they choose to spawn with..
Re: Weapon on spawn -
akib - 15.06.2017
You can try this....
On the top of the script
PHP Code:
new Team;
#define Team_VIP 1 //making team
#define Team_Something
PHP Code:
public OnPlayerSpawn(playerid)
{
if(GetPlayerSkin(playerid) == 230)
{
//GivePlayerWeapon(playerid,weaponid,ammo);
GivePlayerWeapon(playerid,34,1000); //Sniper with 1000 ammos
GivePlayerWeapon(playerid,24,1000); //Desert with 1000 ammos
GivePlayerWeapon(playerid,18,50); //50 moltoves
}
return 1;
}
Re: Weapon on spawn -
Vince - 15.06.2017
AddPlayerClass has all of this literally built in.
Re: Weapon on spawn -
1fret - 15.06.2017
Quote:
Originally Posted by Vince
AddPlayerClass has all of this literally built in.
|
XD who doesn't know that? anyways i dont want to use that i want to make it unique so i just wanted to know how you guys would go about doing it, without using addplayerclass cause i have anti-wephacks.. Anyways , any other suggestions?
Re: Weapon on spawn -
Vince - 15.06.2017
Quote:
Originally Posted by 1fret
XD who doesn't know that?
|
You could fill a book with all the things people don't know. For example some people still insist on using the ancient "PlayerToPoint" when the native IsPlayerInRangeOfPoint has existed since 0.3a. Nothing surprises me anymore. If your anti-cheat flags positives for weapons added with AddPlayerClass then the anti-cheat is bad. Fix the anti-cheat rather than trying to work around it.