22.01.2010, 19:50
pawn Код:
dcmd_tazer(playerid, params[])
{
#pragma unused params
new giveplayer[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
new string[256];
if(IsPlayerConnected(playerid))
{
if(GetPlayerTeam(playerid) == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_RED, "You cannot use this command while your in a car.");
return 1;
}
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
if(gTeam[suspect] == 2)
{
SendClientMessage(playerid, COLOR_RED, "Cannot Tazer A Fellow Cop");
return 1;
}
if(IsPlayerInAnyVehicle(suspect))
{
SendClientMessage(playerid, COLOR_RED, "You cannot tazer someone in a car");
return 1;
}
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You were Tazed by %s for 8 seconds.", sendername);
SendClientMessage(suspect, COLOR_GREEN, string);
format(string, sizeof(string), "* You Tazed %s for 8 seconds.", giveplayer);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "* %s shoots with his Tazer at %s, and tazed him.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_BLUE,COLOR_BLUE,COLOR_BLUE,COLOR_BLUE,COLOR_BLUE);
GameTextForPlayer(suspect, "~r~Tazed", 2500, 3);
TogglePlayerControllable(suspect, 0);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This player is not near you.");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not a Cop.");
}
}//not connected
return 1;
}
I got the proxdetector of there too,
Will it work, Is the question xd