Posts: 56
Threads: 10
Joined: Dec 2008
Reputation:
0
Hi. Can somebody please just write me the code i need to use..
How to make when player (for example "Thomas_Coron")
enter vehicle (for example id. 500 - 501)
he can drive it, but when other players enter vehicle they got kicked out...
Please help, thanks!
Posts: 556
Threads: 21
Joined: Feb 2008
Reputation:
0
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new name;
if(vehicleid == 500 && 501)
{
GetPlayerName(playerid, name, sizeof(name));
if(name == Thomas_Coron)
{
return 1;
}else RemovePlayerFromVehicle(playerid);
}
return 1;
}
You can sort the indentation out, I'v never used getplayername before but in theory that should work.
Posts: 556
Threads: 21
Joined: Feb 2008
Reputation:
0
Oh great, I get flamed for helping...
Sorry if I dont have as much time as other people do.
EDIT: If your so good, why don't you help him instead of commenting negatively on what I have said.
Posts: 556
Threads: 21
Joined: Feb 2008
Reputation:
0
I know, im working on it im working on it.
Did what BM said to do, it failed aswell.
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(vehicleid == 500 || 501)
{
if(strcmp(name, "Thomas_Coron", true))
{
return 1;
}else RemovePlayerFromVehicle(playerid);
}
return 1;
}
Unless im getting something wrong, why dont you help BM seeing as you can give a hint.