/contract fix.
#1

pawn Код:
CMD:contract(playerid, params[]) {
    new
        id;
    if(playerVariables[playerid][pMoney] < 50000) {
    return SendClientMessage(playerid, COLOR_GREY, "You don't have sufficient funds!");
    }
    if(playerVariables[playerid][pMoney] >= 50000) {
    GetPlayerName(id, szPlayerName, MAX_PLAYER_NAME);
    format(szMessage, sizeof(szMessage), "You have contracted %d and been charged $50,000 for the contract.", id);
    SendClientMessage(playerid, COLOR_WHITE, szMessage);
    playerVariables[playerid][pMoney] -= 50000;
    playerVariables[id][pContracted] = 1;
    new
        stringo[255];
    format(stringo, sizeof(stringo), "Somebody has requested a hit on %d. You know what to do.", id);
    foreach(Player, x) {
            if (playerVariables[x][pGroup] == 10 && playerVariables[x][pGroupRank] >= 3) {
                SendClientMessage(x, 0xF0F8FFFF, stringo);
            }
        }
    }
    return 1;
}
Everything is fine until you /contract someone, when you do /contract them, it shows "...15..." 15 isn't my ID, nor is it my name. Will +rep for anyone who posts with something helpful.
http://imgur.com/r9QeY,qvYOB
Reply
#2

Don;t you have to set the id somewhere?
You only made a new id;
but you should set the id to the one you want somewhere , or do I see it wrong?
Reply
#3

The kill part works absolutely fine, it's showing the client the wrong text.
pawn Код:
if(playerVariables[playerid][pContracted] == 1) {
    if(playerVariables[killerid][pGroup] == 10) {
    SendClientMessage(playerid, COLOR_LIGHTRED, "You were struck by a Hitman, they took $25,000 from your corpse.");
    SendClientMessage(killerid, COLOR_LIGHTRED, "Contracted Forfilled. You took $25,000 away from the corpse.");
    playerVariables[playerid][pMoney] -= 25000;
    playerVariables[playerid][pContracted] = 0;
    playerVariables[killerid][pMoney] += 25000;
    }
    }
That works absolutely fine, and /contract sets the hit's pContracted to 1:
pawn Код:
playerVariables[id][pContracted] = 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)