20.03.2012, 02:31
I've been working on a new tazer code. Basically instead of the standard, SDPistol pullout, and fire, it freezes the person nearest to you. But I'm having a bit of trouble. Much help would be appreciated.
And Pawno tells me...
Thanks!
Код:
CMD:tazer(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(IsACop(playerid) || PlayerInfo[playerid][pAdmin] == 6 || PlayerInfo[playerid][pAdmin] == 5) { if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_GREY, " Cannot use this in a vehicle !"); return 1; } new suspect = GetClosestPlayer(playerid); if(IsPlayerConnected(suspect)) { if(PlayerCuffed[suspect] > 0) { SendClientMessage(playerid, COLOR_GREY, " That player is already cuffed !"); return 1; } if(GetDistanceBetweenPlayers(playerid,suspect) < 5) { if(gTeam[suspect] == 2) { SendClientMessage(playerid, COLOR_GREY, " Your tazer cannot penetrate this persons body armor."); return 1; } if(IsPlayerInAnyVehicle(suspect)) { SendClientMessage(playerid, COLOR_GREY, " Suspect is in a vehicle, get him out first !"); return 1; } GetPlayerNameEx(suspect, giveplayerid, sizeof(giveplayerid)); GetPlayerNameEx(playerid, giveplayerid, sizeof(playerid)); format(string, sizeof(string), "* You were tazed by %s for 10 seconds.", giveplayerid); SendClientMessageEx(suspect, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* You tazed %s for 10 seconds.", giveplayerid); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* %s shoots his taser at %s, and subdues him.", playerid , giveplayerid); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GameTextForPlayerEx(suspect, "~r~Tazed", 2500, 3); TogglePlayerControllable(suspect, 0); PlayerCuffed[suspect] = 1; PlayerCuffedTime[suspect] = 10; } else { SendClientMessage(playerid, COLOR_GREY, " There's no-one near you."); return 1; } } } else { SendClientMessage(playerid, COLOR_GREY, " You are not a cop !"); } }//not connected return 1; }
Код:
C:\Users\Administrator\Desktop\Movado 0.3D NGG\0.3D\gamemodes\vrrp.pwn(68057) : error 017: undefined symbol "giveplayerid" C:\Users\Administrator\Desktop\Movado 0.3D NGG\0.3D\gamemodes\vrrp.pwn(68057) : error 017: undefined symbol "giveplayerid" C:\Users\Administrator\Desktop\Movado 0.3D NGG\0.3D\gamemodes\vrrp.pwn(68057) : error 029: invalid expression, assumed zero C:\Users\Administrator\Desktop\Movado 0.3D NGG\0.3D\gamemodes\vrrp.pwn(68057) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.