12.05.2011, 12:57
(
Последний раз редактировалось mu057677; 12.05.2011 в 16:10.
)
I have my script:
And NPCModes:
All most as are normal but command: PutPlayerInVehicle not work? Why?
pawn Код:
new MyFirstNPCVehicle; //Global variable!
public OnFilterScriptInit()
{
print("\n-----------------------------------------");
print(" Bus Driver NPC Script by Tuвn Anh");
print("------------------------------------------\n");
//SetGameModeText("NPC Mode");
ConnectNPC("BusWilliams","williams");
MyFirstNPCVehicle = CreateVehicle(437, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new string[128];
new playername[MAX_PLAYER_NAME];
SetPlayerSkin(playerid,165);
GetPlayerName(playerid,playername,64);
SetPlayerColor(playerid,0xFF8000FF);
format(string, sizeof(string),"Hi all, I am %s(%d) Bus Driver. My ID car: %d", playername, playerid, MyFirstNPCVehicle);
SendPlayerMessageToAll(playerid, string);
Delete3DTextLabel(DutyLabel[playerid]);
DutyLabel[playerid] = Create3DTextLabel("Bus Driver\nWilliams",0xFF000099,0,0,2,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
if(!strcmp(playername, "BusWilliams", true)) {
SetSpawnInfo(playerid, 0, 165, 1529.6,-1691.2,13.3);
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 1);
//return 1;
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}
pawn Код:
#define RECORDING "williamsbusdriver" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.
#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#if RECORDING_TYPE == 1
public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
public OnNPCExitVehicle() StopRecordingPlayback();
#else
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif