25.11.2010, 05:53
(
Последний раз редактировалось Tee; 21.11.2011 в 03:21.
)
Hello fellow friends, this tutorial will teach you how to create organization vehicles.
NOTE: This tutorial is linked to my other tutorial about how to create organizations. However, you can manipulate it to created restricted vehicles on your server.
Lets get started.
Go to the top of your script, below the "#defines" and add:
First, get the coordination for the vehicles ready. Now the new variables that we made, will hold the vehicles.
Now go to OnGameModeInt(); and add:
Now this is the part that we will remove the player from the vehicle if they are not in that org.
Go to OnPlayerStateChane and add:
What the code above is really saying is that. When the player changes state (When they are seated in the SAPD car) it will check if they are in SAPD, and if they are not, it will remove them from the car.
I hope this helped. NB i am not good at tutorials
Note: This is outdated since I made a dynamic MySQL version.
NOTE: This tutorial is linked to my other tutorial about how to create organizations. However, you can manipulate it to created restricted vehicles on your server.
Lets get started.
Go to the top of your script, below the "#defines" and add:
pawn Код:
new SAPD1,SAPD2
Now go to OnGameModeInt(); and add:
pawn Код:
SAPD1 = AddStaticVehicle(598,2256.2041,2476.9424,10.5694,356.1667,0,1); // policecar1
SAPD2 = AddStaticVehicle(598,2256.2522,2442.7004,10.5722,358.7384,0,1); // policecar2
Go to OnPlayerStateChane and add:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD1 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == SAPD2 && Member[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, red, "This is an Organization vehicle!");
}
}
return 1;
}
I hope this helped. NB i am not good at tutorials
Note: This is outdated since I made a dynamic MySQL version.