15.08.2011, 01:40
Hello everyone.
My problem is that my "npc" I put together in a script and I do not know where or how should I put the commands. Please can anyone tell me how?
Here is my scrib:
Pls anyone can say me where I should have put this?
pls help me
My problem is that my "npc" I put together in a script and I do not know where or how should I put the commands. Please can anyone tell me how?
Here is my scrib:
Quote:
//------------------------------------------------- // // NPC initialisation for Grand Larceny // //------------------------------------------------- #pragma tabsize 0 #include <a_samp> //------------------------------------------------- public OnFilterScriptInit() { ConnectNPC("guy1a","guy1"); ConnectNPC("guy2a","guy2"); ConnectNPC("guy3a","guy3"); ConnectNPC("guy4a","guy4"); // Testing //ConnectNPC("TestIdle","onfoot_test"); //ConnectNPC("TaxiTest","mat_test"); return 1; } //------------------------------------------------- // IMPORTANT: This restricts NPCs connecting from // an IP address outside this server. If you need // to connect NPCs externally you will need to modify // the code in this callback. public OnPlayerConnect(playerid) { if(IsPlayerNPC(playerid)) { new ip_addr_npc[64+1]; new ip_addr_server[64+1]; GetServerVarAsString("bind",ip_addr_server,64); GetPlayerIp(playerid,ip_addr_npc,64); if(!strlen(ip_addr_server)) { ip_addr_server = "127.0.0.1"; } if(strcmp(ip_addr_npc,ip_addr_server,true) != 0) { // this bot is remote connecting printf("NPC: Got a remote NPC connecting from %s and I'm kicking it.",ip_addr_npc); Kick(playerid); return 0; } printf("NPC: Connection from %s is allowed.",ip_addr_npc); } return 1; } //------------------------------------------------- public OnPlayerRequestClass(playerid, classid) { if(!IsPlayerNPC(playerid)) return 0; // We only deal with NPC players in this script new playername[64]; GetPlayerName(playerid,playername,64); if(!strcmp(playername,"guy1a",true)) { SetSpawnInfo(playerid,0,100,1953.2028,-2338.2466,16.7901,129.2776,0,0,0,0,0,0); } else if(!strcmp(playername,"guy2a",true)) { SetSpawnInfo(playerid,0,159,1954.6483,-2343.6621,17.2891,143.3777,0,0,0,0,0,0); } else if(!strcmp(playername,"guy3a",true)) { SetSpawnInfo(playerid,0,59,1954.0103,-2328.2612,16.5399,39.9768,0,0,0,0,0,0); } else if(!strcmp(playername,"guy4a",true)) { SetSpawnInfo(playerid,0,11,1956.6311,-2329.3193,17.5657,89.3156,0,0,0,0,0,0); } return 0; } //------------------------------------------------- public OnPlayerSpawn(playerid) { if(!IsPlayerNPC(playerid)) return 1; // We only deal with NPC players in this script new playername[64]; GetPlayerName(playerid,playername,64); if(!strcmp(playername,"guy1a",true)) { SetPlayerColor(playerid,0xFFFFFFFF); } else if(!strcmp(playername,"guy2a",true)) { SetPlayerColor(playerid,0xFFFFFFFF); } else if(!strcmp(playername,"guy3a",true)) { SetPlayerColor(playerid,0xFFFFFFFF); } else if(!strcmp(playername,"guy4a",true)) { SetPlayerColor(playerid,0xFFFFFFFF); } return 1; } //------------------------------------------------- // EOF |
Quote:
ApplyAnimation(playerid,"Attractors","Stepsit_in", 4.1,0,0,0,1,0); |