Vehicle help
#1

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!
Reply
#2

use is player shit, ehm, i'll give you the code when I gethome, k ?
Reply
#3

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.
Reply
#4

Quote:
Originally Posted by NeRoSiS
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.
He will need to sort out alot more than indentation ya fucking noob. You helped nobody by posting this random shit

In future, try and COMPILE any code you think will work
Reply
#5

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.
Reply
#6

Quote:
Originally Posted by NeRoSiS
Oh great, I get flamed for helping...
But your not helping anybody by posting code that will not work

Cant you see that?

Go learn how stuff works and then start helping people once you know what your talking about

Its not about being good cos im not that great, its about knowing how to do it.. It's not hard, all he has to do is search for the answer, if it doesnt work then he can try, and try, and try again untill it works otherwise he doesnt learn nothing if someone just gives him the (correct) code. They should start banning cunts in here for asking questions that are already answered on the wiki / search anyway like "how to add cars" :P

I just browse the forums really and had to comment

*sigh*

Infact I will help him by saying he should search for strcmp and by saying that the players name has to match "Thomas_Coron". Using strcmp (String Compare) will work wonders
Reply
#7

Quote:
Originally Posted by BM[UK
]
Quote:
Originally Posted by NeRoSiS
...
Instead of making a discussion, just try to help him, seems a better solution.
Reply
#8

Quote:
Originally Posted by BM[UK
]
Quote:
Originally Posted by NeRoSiS
Oh great, I get flamed for helping...
But your not helping anybody by posting code that will not work

Cant you see that?

Go learn how stuff works and then start helping people once you know what your talking about

Its not about being good cos im not that great, its about knowing how to do it.. It's not hard, all he has to do is search for the answer, if it doesnt work then he can try, and try, and try again untill it works otherwise he doesnt learn nothing if someone just gives him the (correct) code. They should start banning cunts in here for asking questions that are already answered on the wiki / search anyway like "how to add cars" :P

I just browse the forums really and had to comment

*sigh*

Infact I will help him by saying he should search for strcmp and by saying that the players name has to match "Thomas_Coron". Using strcmp (String Compare) will work wonders
All your going to do is give him a hint? Arent you a nice guy.

Mine may have one error, the GetPlayerName, simply because I don't have time to test it, but just for you I will now, and I will see if it works.

EDIT: Okay so my script /failed completely, but at least I made an effort to help the guy, thats the point in this forum, not to look over everyon like a god and smite them when they make a mistake.

lot4r, I will try and find something tht works as this guy dont want to help yet he claims he knows what to do.
Reply
#9

Doesnt work
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)