27.01.2012, 17:11
This command is writed to rape other near players:
Function:
When i compile i got tons of errors not releated to the code,what's wrong in that command?
pawn Код:
CMD:rape(playerid, params[])
{
if(IsPlayerNearPlayer(playerid, 5.0)){
SendClientMessage(playerid, COLOR_WHITE, "Raped player.");
return 1;
}else{
SendClientMessage(playerid, COLOR_WHITE, "You are NOT near a player so you can't attemp to rape him.");
return 1;
if(gTeam[playerid] == TEAM_COP) return SendClientMessage(playerid, red, "Cops can't rape other players!");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You can't rape a player if you are in a vehicle!");
if(IsSpawned[playerid] == 0) return SendClientMessage(playerid,0xFF0000FF,"You can't use this command when you are dead or spawning.");
if(GetPVarInt(playerid,"RapeTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"Please wait 10 seconds before rape again.");
SetPVarInt(playerid,"RapeTime",GetTickCount()+10000);
return true;
}
pawn Код:
forward IsPlayerNearPlayer(playerid, n_playerid, Float:radius);
pawn Код:
IsPlayerNearPlayer(playerid, n_playerid, Float:radius){
new Float:npx, Float:npy, Float:npz;
GetPlayerPos(n_playerid, npx, npy, npz);
if(IsPlayerInRangeOfPoint(playerid, radius, npx, npy, npz)){
return true;
}else{
return false;
}
}