SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/09/2012, 03:40 PM   #1
Nirzor
Gangsta
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 523
Reputation: 60
Default Little Help +Rep

can some-one give me the codes

Code:
#define SOLDIER 1
#define SNIPER 2
#define AGENT 3
#define MECHANIC 4
#define MEDIC 5
#define SPECIAL_AGENT 6
these are my 6 classes now i want AGENT to drive hydra and sea sparrow only and Mechanic tank only

and Special_Agent will have access to all tank and hydra and sea sparrow can some-one give me the codes

to make that system plz
__________________
Our Gaming Community [UG] Gaming. Join my community today.
[UG] Gaming Forums : www.un-gaming.com

Looking for someone with an advanced TDM script , if you have one contact me on skype : emaz.ahmed7 ill put it on hosted tab.
Nirzor is offline   Reply With Quote
Old 16/09/2012, 03:45 PM   #2
AtItsMax
Big Clucker
 
AtItsMax's Avatar
 
Join Date: Sep 2012
Location: 44
Posts: 62
Reputation: 14
Default Re: Little Help +Rep

pawn Code:
new PickedClass[MAX_PLAYERS];
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(PickedClass != AGENT && GetVehicleModel(vehicleid) == hydra id here)
    {
        ClearAnimations(playerid);
        SendClientMessage(playerid, -1, "[*]: You should be Agent in order to drive hydra!");
    }
return 1;
}
This is an example, you can do other's this way.
AtItsMax is offline   Reply With Quote
Old 16/09/2012, 03:46 PM   #3
Nirzor
Gangsta
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 523
Reputation: 60
Default Re: Little Help +Rep

i can't do like this some-one has to show me whole code so i can learn from it so next time i can do myself
__________________
Our Gaming Community [UG] Gaming. Join my community today.
[UG] Gaming Forums : www.un-gaming.com

Looking for someone with an advanced TDM script , if you have one contact me on skype : emaz.ahmed7 ill put it on hosted tab.
Nirzor is offline   Reply With Quote
Old 16/09/2012, 04:15 PM   #4
diego_p11
Big Clucker
 
Join Date: Aug 2011
Posts: 70
Reputation: 5
Default Re: Little Help +Rep

Ok, i will use atltsmax' script as an example.

new PickedClass[MAX_PLAYERS]; (here, it checks if its in a class)
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) (here it makes the server check that the player has entered a vehicle)
{
* * if(PickedClass != AGENT && GetVehicleModel(vehicleid) == hydra id here) (here it checks if the player is with the correct class to use the vehicle (on where is says "hydra id here" you place the id of the vehicle the player is supposed to use))
* * {
* * * * ClearAnimations(playerid); (and here if the player dont completes with the requirements to use the vehicles, gets ejected from it)
* * * * SendClientMessage(playerid, -1, "[*]: You should be Agent in order to drive hydra!"); (and finally here, sends a message to the player saying him which class he has to be to use that vehicle)
* * }
return 1; (at the end, it shows to the server that is a valid action, and to make it work on your server)
}

Hopw i helped you, if I did give me rep
diego_p11 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 06:52 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.