dcmd_tazer(playerid, params[])
{
new id;
new name[MAX_PLAYER_NAME], string[48];
if (strlen(params))
{
id = strval(params);
if (IsPlayerConnected(id))
{
if(GetPlayerTeam(playerid) == 1)
{
if(!IsPlayerInAnyVehicle(playerid))
{
GetDistanceBetweenPlayers(playerid,id) <5)
{
if(GetPlayerTeam(id) == 1)
{
SendClientMessage(playerid, 0xFF0000AA, "You cannot tazer a fellow cop");
return 1;
}
if(IsPlayerInAnyVehicle(id))
{
SendClientMessage(playerid, 0xFF0000AA, "You cannot tazer someone in a vehicle");
return 1;
}
ApplyAnimation(playerid,"CRACK","crckdeth2",4.1,1,1,1,1,1);
TogglePlayerControllable(id,0);
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Police Officer %s has tazed you for 8 seconds.", name );
SendClientMessage(id, 0xFFFF00AA, string);
GetPlayerName(id, name1, sizeof(name1));
format(string, sizeof(string), "You have tazed %s.", name1 );
SendClientMessage(playerid, 0xFFFF00AA, string);
//format(string, sizeof(string), "* %s shoots with his Tazer at %s, and tazed him.", sendername ,giveplayer);
//ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("Tazer", 8000, 0, "i", playerid);
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You cannot use this command while in a vehicle");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You are not a Cop");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: /tazer [PlayerID/PartOfName]");
}
return 1;
}
forward Tazer(playerid);
public Tazer(playerid)
{
TogglePlayerControllable(id, 1);
SendClientMessage(id, COLOR_GREEN, "The effect of the tazer has worn off");
}
C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(223) : error 004: function "GetDistanceBetweenPlayers" is not implemented C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(241) : error 033: array must be indexed (variable "dcmd_tazer") C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(610) : error 004: function "GetDistanceBetweenPlayers" is not implemented C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(610) : error 029: invalid expression, assumed zero C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(615) : error 079: inconsistent return types (array & non-array) C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(617) : warning 217: loose indentation C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(620) : error 079: inconsistent return types (array & non-array) C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(627) : error 017: undefined symbol "name1" C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(627) : error 017: undefined symbol "name1" C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(627) : error 029: invalid expression, assumed zero C:\Program Files\Rockstar Games\GTA San Andreas\sa-mp\gamemodes\gamemode.pwn(627) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 10 Errors.
Originally Posted by Don Correlli
How about if you learn PAWN basics first? You're asking too much questions on the forum, you're 1st in "Top Topic Starters".
You can't expect others to fix the code for you all the time if you don't want to learn some basics yourself. |
Originally Posted by kmzr
These are the simplest of errors to fix, use the search function and find out what causes the above errors.
|
if(strcmp(cmd, "/tazer", true) ==0) { if(IsPlayerConnected(playerid)) { if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pAdmin] == 1337 || PlayerInfo[playerid][pAdmin] == 1338) { if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_GREY, " Cannot use this while being in the Car !"); return 1; } new suspect = GetClosestPlayer(playerid); if(IsPlayerConnected(suspect)) { if(PlayerCuffed[suspect] > 0) { SendClientMessage(playerid, COLOR_GREY, " Player already Cuffed !"); return 1; } if(GetDistanceBetweenPlayers(playerid,suspect) < 5) { if(gTeam[suspect] == 2) { SendClientMessage(playerid, COLOR_GREY, " Cannot Tazer Cops / FBI / National Guard !"); return 1; } if(IsPlayerInAnyVehicle(suspect)) { SendClientMessage(playerid, COLOR_GREY, " Suspect is in a Car, get him out first !"); return 1; } GetPlayerName(suspect, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* You were Tazed by %s for 10 seconds.", sendername); SendClientMessage(suspect, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* You Tazed %s for 10 seconds.", giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* %s shoots with his Tazer at %s, and tazed him.", 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); PlayerCuffed[suspect] = 1; PlayerCuffedTime[suspect] = 10; } else { SendClientMessage(playerid, COLOR_GREY, " No-one near you!"); return 1; } } } else { SendClientMessage(playerid, COLOR_GREY, " You are not a Cop / FBI / National Guard !"); } }//not connected return 1; }