Rape Command fail
#1

pawn Код:
dcmd_rape(playerid, params[])
{
    if(gTeam[playerid] == TEAM_RAPTIST)
    {
        new targetid, string[128];

        new playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername, sizeof(playername));
        GetPlayerName(targetid, targetname, sizeof(targetname));

        if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /rape (id)");
        else if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "Invalid ID");
        else if(IsSpawned[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
        else if(Jailed[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in jail");
        else if(targetid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot rape yourself");
        else if(GetDistanceBetweenPlayers(playerid, targetid) > 3)
        {
            format(string, sizeof(string), "%s(%d) Is not close enough to get raped", targetname, targetid);
            SendClientMessage(playerid, COLOR_ERROR, string);
            return 1;
        }
        else
        {
            format(string, sizeof(string), "%s(%d) has raped you", playername, playerid);
            SendClientMessage(targetid, COLOR_GREEN, string);

            format(string, sizeof(string), "You raped %s(%d)", targetname, targetid);
            SendClientMessage(playerid, COLOR_GREEN, string);

            format(string, sizeof(string), "%s(%d) has raped %s(%d)", playername, playerid, targetname, targetid);
            printf("%s", string);

            AIDS[targetid] = 1;
            return 1;
        }
    }
    return 0;
}
That command and some other commands is getting wrong Name

My Name: Unknown123
My Brothers name: Abc123

I raped my brother (Ingame)


This got printed in my Log
Код:
[21:40:33] Unknown123(0) has raped Unknown123(1)
Reply
#2

Try taking out the return 1; from there:

Код:
else if(GetDistanceBetweenPlayers(playerid, targetid) > 3)
        {
            format(string, sizeof(string), "%s(%d) Is not close enough to get raped", targetname, targetid);
            SendClientMessage(playerid, COLOR_ERROR, string);
            return 1;
        }
Just a sggestion.

BTW. It's abit sick rape'in you bro man.
Reply
#3

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Try taking out the return 1; from there:

Код:
else if(GetDistanceBetweenPlayers(playerid, targetid) > 3)
        {
            format(string, sizeof(string), "%s(%d) Is not close enough to get raped", targetname, targetid);
            SendClientMessage(playerid, COLOR_ERROR, string);
            return 1;
        }
Just a sggestion.

BTW. It's abit sick rape'in you bro man.
Why remove return 1; what effect does it have?

;Yeah i know xD
Reply
#4

It's just a suggestion, perhaps if you return there, you might not be getting to the names part of your code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)