01.08.2011, 20:19
ok so i made 2 cars that check for drivers name ,if the drivers name is NOT the one i put in the script,he gets ejected ,therefore its a personal car .
ill show here the entire code so people can help me out
the problem is , 1 of 2 cars works,but the other says im not in the Hitman faction ,i remember i had this problem when i tried to put my private cars into a filterscript cause they got mixed up with GM's cars ,but this time its in the GM and i dont know why they get mixed up
ill show here the entire code so people can help me out
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new string[256];
new newcar = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) MyOldCar[playerid] = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(newcar == NAMEOFCARxD)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(strcmp(PlayerName, "Player_nameblablabla", true) == 0)
{
SendClientMessage(playerid, COLOR_1BLUE,"* Welcome to your car.");
}
else
{
RemovePlayerFromVehicle(playerid);
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
SendClientMessage(playerid, COLOR_RED," This vehicle is not for you.");
}
}