/rape problem
#1

This command is writed to rape other near players:

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;
}
Function:

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;
    }
}
When i compile i got tons of errors not releated to the code,what's wrong in that command?
Reply
#2

Tag mismatch:

pawn Код:
if(IsPlayerNearPlayer(playerid, 5.0))
Thank you.
Reply
#3

why would you make /rape...

thats just wrong
Reply
#4

Quote:
Originally Posted by milanosie
Посмотреть сообщение
why would you make /rape...

thats just wrong
It's a cops&robbers gamemode,and the /rape command is for civilians team...
Reply
#5

Nope,i get tag mismatch here:

pawn Код:
if(IsPlayerNearPlayer(playerid, 5.0))
Reply
#6

IsPlayerNearPlayer(playerid, n_playerid, Float:radius){

Which means you need 2 of the playerids,

so...
pawn Код:
if(IsPlayerNearPlayer(playerid, n_playerid, 5.0))
Reply
#7

pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "You are NOT near a player so you can't attemp to rape him.");
Shouldn't it be:
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "You are NOT near a player so you can't attemp to rape him/her.");
Reply
#8

"undefined symbol "n_playerid""

epic.

I just need,when player uses /rape,it rape the closest player,not a specified id.
Reply
#9

It's your function lol. That's what you had in the function. Give me a few minutes to re-read the whole code.
Reply
#10

Quote:
Originally Posted by Abreezy
Посмотреть сообщение
It's your function lol. That's what you had in the function. Give me a few minutes to re-read the whole code.
Yeah i know but it's strange,lol.Every function i make is not giving me problems,only these
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)