05.08.2013, 01:33
You could do this.
pawn Код:
new vcar_names[MAX_PLAYER_NAME][25];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid =GetPlayerVehicleID(playerid);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof pname);
if (newstate == PLAYER_STATE_DRIVER)
{
if (vehicleid == vcar[0])
{
if(strcmp(pname, vcar_names[0] true) == 0)
{
SendClientMessage(playerid, COLOR_RED, "WELCOME VIP");
return 1;
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "THIS VEHICLE DOES NOT BELONG TO YOU");
}
}
}
return 1;
}
// then you create them this way, setting their name/owner
vcar[0] = CreateVehicle(...);
vcar_names[0] = "Marricio";
vcar[1] = CreateVehicle(...);
vcar_names[1] = "John";
vcar[2] = CreateVehicle(...);
vcar_names[2] = "kaos999";
vcar[etc..] = CreateVehicle(...);
vcar_names[etc..] = "anyname";