16.07.2013, 21:22
Alright so i got private cars code. Name1 works fine, but in Name2 anyone can drive the car and no client message shows..... this is the code-.. no errors
Код:
if(newstate == PLAYER_STATE_DRIVER) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); new v = GetPlayerVehicleID(playerid); if(v == name1car) { if(!strcmp(pname, "Name1", true)) { SendClientMessage(playerid, COLOR_RED, "Welcome to your car"); } else { SendClientMessage(playerid, COLOR_RED, "This car is private."); RemovePlayerFromVehicle(playerid); } } return 1; } if(newstate == PLAYER_STATE_DRIVER) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); new v = GetPlayerVehicleID(playerid); if(v == Name2) { if(!strcmp(pname, "Name2", true)) { SendClientMessage(playerid, COLOR_RED, "Yo welcome to your car"); } else { SendClientMessage(playerid, COLOR_RED, "Car is private"); RemovePlayerFromVehicle(playerid); } } return 1; }