08.09.2009, 17:54
hi
hmm
i have a server with a bot that drive a shamal around the san andreas, when he arrives at an airport, the server send a message to all players, example: "The shamal is now on LS airport waiting for passengers", the problem is, he floods the chat every 500 miliseconds, cause i make a timer, how i can make the server send a message for all one more time only?
and, i added the shamal fs to my server, but he dont work, when i press G, nothing happen...
thx and sry for bad english..
the code:
obs: the "O shamal estб agora no Aeroporto de LS esperando por passageiros." is "the shamal is now on ls airport waiting for passengers" on my language.
obs2: im noob on pawn
thx and sry for bad english................... again
hmm
i have a server with a bot that drive a shamal around the san andreas, when he arrives at an airport, the server send a message to all players, example: "The shamal is now on LS airport waiting for passengers", the problem is, he floods the chat every 500 miliseconds, cause i make a timer, how i can make the server send a message for all one more time only?
and, i added the shamal fs to my server, but he dont work, when i press G, nothing happen...
thx and sry for bad english..

the code:
Код:
#pragma tabsize 0 #include <a_samp> new MyFirstNPCVehicle; new SultanLSTour; new tourtxt; new vshamal; forward onairport(playerid); forward anim(playerid); //------------------------------------------------- public onairport(playerid) { new playername[64]; GetPlayerName(playerid,playername,64); if(!strcmp(playername,"shamal",true)) if(IsPlayerInRangeOfPoint(playerid, 100.0, 1969.8297,-2306.2217,14.7241)) { SendClientMessageToAll(0xDEEE20FF, "O shamal estб agora no Aeroporto de LS esperando por passageiros."); } if(!strcmp(playername,"shamal",true)) if(IsPlayerInRangeOfPoint(playerid, 100.0, -1540.3843,-210.6422,17.2489)) { SendClientMessageToAll(0xDEEE20FF, "O shamal estб agora no Aeroporto de SF esperando por passageiros."); } if(!strcmp(playername,"shamal",true)) if(IsPlayerInRangeOfPoint(playerid, 100.0, 1615.1504,1608.8933,11.9160)) { SendClientMessageToAll(0xDEEE20FF, "O shamal estб agora no Aeroporto de LV esperando por passageiros."); } return 1; } public OnFilterScriptInit() { SetTimer("anim", 500, 1); SetTimer("onairport", 500, 1); MyFirstNPCVehicle = AddStaticVehicle(567,1527.6833,-1039.5702,23.3538,70.0264,74,72); // carspawnpoint SultanLSTour = AddStaticVehicle(560,1524.0270,-1047.0073,23.5044,249.1542,0,0); //tourls sultan spawn vshamal = AddStaticVehicle(519,1468.5172,1284.1729,11.7919,194.1353,1,1); tourtxt = Create3DTextLabel("LS Tour", 0xFFFFFFFF, 1524.0270,-1047.0073,23.5044, 50.0, 0); Attach3DTextLabelToVehicle(tourtxt, SultanLSTour, 0.0, 0.0, 1.0); ConnectNPC("shamal","shamal"); ConnectNPC("NPC1","mynpc"); ConnectNPC("NPC2","mynpc2"); ConnectNPC("Cop","cop"); return 1; } //------------------------------------------------- public anim(playerid) { new playername[64]; GetPlayerName(playerid,playername,64); if(!strcmp(playername, "Cop", true)) { LoopingAnim(playerid,"Strip","STRIP_C",4.0,1,1,1,1,0); } return 1; } new gPlayerUsingLoopingAnim[MAX_PLAYERS]; LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp) { gPlayerUsingLoopingAnim[playerid] = 1; ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp); } public OnPlayerRequestClass(playerid, classid) { if(!IsPlayerNPC(playerid)) return 0; new playername[64]; GetPlayerName(playerid,playername,64); if(!strcmp(playername,"NPC1",true)) { SetSpawnInfo(playerid,69,255,1527.6833,-1039.5702,23.3538,0.0,-1,-1,-1,-1,-1,-1); } if(!strcmp(playername,"NPC2",true)) { SetSpawnInfo(playerid,69,255,1524.0270,-1047.0073,23.5044,0.0,-1,-1,-1,-1,-1,-1); } if(!strcmp(playername,"Cop",true)) { SetSpawnInfo(playerid,69,283,1537.3004,-1035.7268,23.8041,0.0,-1,-1,-1,-1,-1,-1); } if(!strcmp(playername,"shamal",true)) { SetSpawnInfo(playerid,69,255,1473.3497,1267.5237,10.8203,0.0,-1,-1,-1,-1,-1,-1); } return 0; } public OnPlayerSpawn(playerid) { if(!IsPlayerNPC(playerid)) return 1; new playername[64]; GetPlayerName(playerid,playername,64); if(!strcmp(playername, "NPC1", true)) { PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); SetPlayerColor(playerid,0xFFFFFFFF); } if(!strcmp(playername, "NPC2", true)) { PutPlayerInVehicle(playerid, SultanLSTour, 0); SetPlayerColor(playerid,0xFFFFFFFF); } if(!strcmp(playername, "cop", true)) { SetPlayerColor(playerid,0xFFFFFFFF); } if(!strcmp(playername, "shamal", true)) { PutPlayerInVehicle(playerid, vshamal, 0); SetPlayerColor(playerid,0xFFFFFFFF); } return 1; }
obs2: im noob on pawn
thx and sry for bad english................... again