22.01.2010, 20:42
pawn Код:
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.