little help
#1

how i make a cmd /accept invite and /decline invite ?? and how i make when leader type /giverank ID to change skin to member to the mafia etc. can any help me ?
Reply
#2

Код:
new challengedPlayers[MAX_PLAYERS];
new challengers[MAX_PLAYERS];

dcmd_duel(playerid, params[]) {
     new id = strval(params[0]);
     challengers[playerid] = 1;
     challengedPlayers[playerid] = 1;
     
     SendClientMessage(id, 0x0000FF, "You have been challenged to a duel! Type /accept or decline.");
}

dcmd_accept(playerid, params[]) {
     new id = params[0] //Challenger ID.
     if (challengedPlayers[playerid] == 1 && IsPlayerConnected(playerid) && IsPlayerConnected(id)) {
           //Start duel
     }
}

dcmd_decline(playerid, params[]) {
     new id = params[0] //Challenger ID.
     challengedPlayers[playerid] = 0;
     challengers[id] = 0;
     SendClientMessage(id, 0xCC0000, "Your opponent refused your challenge.");
     return 1;
}
This would require you to type /accept (ID) or /decline (ID). I did this quick and didn't include all the validation you should have, but it should push you in the right direction. I suggest you use /accept (id) instead of just /accept in case someone gets challenged twice before typing /accept or /decline...it would make things more difficult.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)