PDA

View Full Version : Weapon on spawn


1fret
15/06/2017, 05:03 AM
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..

akib
15/06/2017, 07:28 AM
You can try this....

On the top of the script

new Team;
#define Team_VIP 1 //making team
#define Team_Something




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;
}

Vince
15/06/2017, 10:47 AM
AddPlayerClass has all of this literally built in.

1fret
15/06/2017, 07:16 PM
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?

Vince
15/06/2017, 07:34 PM
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.