SA-MP Forums Archive
/RAC NPC HELP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /RAC NPC HELP (/showthread.php?tid=378138)



/RAC NPC HELP - Pillhead2007 - 16.09.2012

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(4200.00.05.00.0665000);
return 
true;
}
public 
OnPlayerSpawn(playerid)
{
  if(
IsPlayerNPC(playerid))
  {
  new 
npcname[MAX_PLAYER_NAME];
  
GetPlayerName(playeridnpcnamesizeof(npcname));
  if(!
strcmp(npcname"Dave"true))
  {
    
PutPlayerInVehicle(playeridDaveNPCVehicle0);
    
SetPlayerSkin(playerid,7);
    
SetPlayerColor(playeridCOL_ORANGE);
  }
  
ShowTXTDRW(playerid);
  new 
name[MAX_PLAYER_NAME];
  
GetPlayerName(playeridnamesizeof(name));
  
printf("(%i) %s Has Been Spawned."playeridname);
  print(
"Dave Has Been Placed In His Taxi.");
  return 
true;
  }
  return 
true;
}
YCMD:rac(playeridparams[], help)//LVL4
{
  
#pragma unused help
  #pragma unused params
  
for(new car 0car <MAX_CARScar++) {
  
VehicleHaveDriver(car);
  
SetVehicleToRespawn(car); }
  new 
npcname[MAX_PLAYER_NAME];
  
GetPlayerName(playeridnpcnamesizeof(npcname));
  
PutPlayerInVehicle(playeridDaveNPCVehicle0);
  return 
true;




Re: /RAC NPC HELP - Pillhead2007 - 24.12.2012

#Bump Anyone!