CMD:cuff(playerid, params[])
{
if(gTeam[playerid] != Cops) return SendClientMessage(playerid, -1, " * You aren't a cop *");
new targetid;
if(sscanf(params, "r", targetid)) return SendClientMessage(playerid, -1, " * /cuff Name/ID *");
if(IsPlayerConnected(targetid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
new str[60];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), " * You have cuffed %s *",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), " * You have been cuffed by %s *",name);
SendClientMessage(targetid, 0xE01B1B, str);
SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);
}
}
return 1;
}
CMD:uncuff(playerid, params[])
{
if(gTeam[playerid] != Cops) return SendClientMessage(playerid, -1, " * You aren't a cop *");
new targetid;
if(sscanf(params, "r", targetid)) return SendClientMessage(playerid, -1, " * /uncuff Name/ID *");
if(IsPlayerConnected(targetid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
if(!SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000))
return SendClientMessage(playerid,-1,"ERROR: The player is not cuffed!");
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
new str[60];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), " * You have uncuffed %s *",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), " * You have been uncuffed by %s *",name);
SendClientMessage(targetid, 0xE01B1B, str);
}
}
return 1;
}
new pCuffed[MAX_PLAYERS];
CMD:arrest(playerid, params[])
{
new targetid, time, string[128];
if(gTeam[playerid] != Cops) return SendClientMessage(playerid, -1, " * You aren't a cop *");
if(sscanf(params, "ui", targetid, time)) return SendClientMessage(playerid, -1, " * /arrest Name/ID *");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xAFAFAFFF, "Invalid player id.");
if(!IsPlayerNearPlayer(playerid, targetid, 2)) return SendClientMessage(playerid, 0xAFAFAFFF, "You are too far away from that player.");
if(!pCuffed(playerid) == 1) return SendClientMessage(playerid, 0xAFAFAFFF, "Player Isn't Cuffed!");
format(str, sizeof(str), " * You have arrested %s *",GetPlayerName(targetid));
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), " * You have been arrested by %s *",GetPlayerName(playerid));
SendClientMessage(targetid, 0xE01B1B, str);
SetPlayerInterior(targetid, 0);
SetPlayerVirtualWorld(targetid, 0);
SetPlayerPos(targetid, 263.343597, 77.532028, 1001.039062);
RemovePlayerAttachedObject(playerb, 0);
SetTimer("Arrest", time, true);
SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE);
return 1;
}
stock IsPlayerNearPlayer(playerid, targetid, Float:radius)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
{
return 1;
}
return 0;
}
(sscanf(params, "r", targetid))
if(sscanf(params, "u", targetid))
pCuffed(playerid) == 1;
pCuffed(playerid) == 0;
top of the script:
and the pawn Код:
pawn Код:
|
C:\Users\Sergeant Schizo\Desktop\Project SA-MP\gamemodes\Project.pwn(1275) : error 012: invalid function call, not a valid address
C:\Users\Sergeant Schizo\Desktop\Project SA-MP\gamemodes\Project.pwn(1275) : warning 215: expression has no effect
C:\Users\Sergeant Schizo\Desktop\Project SA-MP\gamemodes\Project.pwn(1275) : error 001: expected token: ";", but found ")"
C:\Users\Sergeant Schizo\Desktop\Project SA-MP\gamemodes\Project.pwn(1275) : error 029: invalid expression, assumed zero
C:\Users\Sergeant Schizo\Desktop\Project SA-MP\gamemodes\Project.pwn(1275) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
I was away for a while, and yeah there is errors when I compile, on
pCuffed(playerid) == 1; pCuffed(playerid) == 0; if(!pCuffed(playerid) == 1) return SendClientMessage(playerid, 0xAFAFAFFF, "Player Isn't Cuffed!"); pawn Код:
|