05.08.2009, 20:27
After Several Several Minutes of working, I finished my /taze Command!
![smiley](images/smilies/smile.gif)
Buuut..... It wont work, I fixed several errors but i still have a few more.
Put this into your Pawno and compile it to see the errors i get.
![smiley](images/smilies/smile.gif)
Buuut..... It wont work, I fixed several errors but i still have a few more.
Put this into your Pawno and compile it to see the errors i get.
Код:
if(strcmp(cmd, "/taze", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_RED, "You must step out the vehicle to use your tazer."); return 1; } new suspect = GetClosestPlayer(playerid); if(IsPlayerConnected(suspect)) { if(GetDistanceBetweenPlayers(playerid,suspect) < 5) return 1; { if(IsPlayerInAnyVehicle(suspect) { SendClientMessage(playerid, COLOR_RED, "You cant taze that person, Becouse they are in a car."); return 1; } GetPlayerName(suspect, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new randt = random(4)+1; if(randt == 1) { format(string, sizeof(string), "* %s shoots with his/her Tazer at %s, but missed.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } else { format(string, sizeof(string), "* %s Hit you with a Tazer! ", sendername); SendClientMessage(suspect, COLOR_RED, string); format(string, sizeof(string), "* %s Will Not Be getting up for 20 Seconds! ", giveplayer); SendClientMessage(playerid, COLOR_RED, string); format(string, sizeof(string), "* %s shoots with his/her Tazer at %s and tazed him/her.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GameTextForPlayer(suspect, "~r~Tazed", 2500, 3); TogglePlayerControllable(suspect, 0); LoopingAnim(suspect, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); PlayerCuffed[suspect] = 1; PlayerCuffedTime[suspect] = 20; } } else { SendClientMessage(playerid, COLOR_RED, " No one is near you to taze."); return 1; return 1; }