16.09.2012, 15:17
Hi Basically I Had It Perfect Running Everytime I would Run The /rac Command All Vehicles Would Respawn Even The NPC'S Vehicle Then PutPlayerInVehicle Would Put NPC in Vehicle And Now Its Not Working , I Have Altered Many Times So I Cant Remember Original Code So Here My Code Below , Please Can Someone Help Me? Thanks
PHP код:
public OnGameModeInit()
{
ConnectNPC("Dave","Taxi2CJHNBackSP1");
DaveNPCVehicle = CreateVehicle(420, 0.0, 0.0, 5.0, 0.0, 6, 6, 5000);
return true;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Dave", true))
{
PutPlayerInVehicle(playerid, DaveNPCVehicle, 0);
SetPlayerSkin(playerid,7);
SetPlayerColor(playerid, COL_ORANGE);
}
ShowTXTDRW(playerid);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
printf("(%i) %s Has Been Spawned.", playerid, name);
print("Dave Has Been Placed In His Taxi.");
return true;
}
return true;
}
YCMD:rac(playerid, params[], help)//LVL4
{
#pragma unused help
#pragma unused params
for(new car = 0; car <MAX_CARS; car++) {
VehicleHaveDriver(car);
SetVehicleToRespawn(car); }
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
PutPlayerInVehicle(playerid, DaveNPCVehicle, 0);
return true;
}