Posts: 159
Threads: 50
Joined: Apr 2009
Reputation:
0
Hello, I need help with something.
Example: I made a car in my server, and I want that only one person will be able to drive it, and if someone else gets in as a driver the car ejects him with showing a message that this car belongs only to me. Is it hard to make?
-Thank you.
Posts: 159
Threads: 50
Joined: Apr 2009
Reputation:
0
Well Its only half what I wanted it todo, all it dose meanwhile is sending me a message when I get in it, But other people can still get in as drivers and drive it.. and It dosent show nothing to them.
And I need a script that will allow only a unique player to drive this ride.
Max_Coldheart
Unregistered
Quote:
Originally Posted by aircombat
under OnGameModeInit :
pawn Код:
MyVehicle = AddStaticVehicle(.....)
then under OnPlayerEnterVehicle :
pawn Код:
new pName[24]; GetPlayerName(playerid,pName,24); if(vehicleid == MyVehicle) { if(!strcmp("The Name You Want",pName,true)) { SendClientMessage(playerid,COLOR_RED,"Welcome To Your Vehicle"); return 1; } } else return SendClientMessage(playerid,COLOR_RED,"This Isn't Your Vehicle");
|
under OnGameModeInit :
pawn Код:
MyVehicle = AddStaticVehicle(.....)
pawn Код:
public OnPlayerStateChange
{
If(newstate == PLAYER_STATE_DRIVER)
{
new pName[24]; GetPlayerName(playerid,pName,24);
if(vehicleid == MyVehicle)
{
if(!strcmp("The Name You Want",pName,true))
{
SendClientMessage(playerid,COLOR_RED,"Welcome To Your Vehicle");
return 1;
}
} else return SendClientMessage(playerid,COLOR_RED,"This Isn't Your Vehicle");
EDIT: Sorry if doesn work. Wrote with iPod