Accepting a command.
#1

I'm going to be developing a little faction system soon, after a while of making systems I think I may be ready. All I want now is for somebody to give me a little boost so that I can understand this and take it with me.

How do you make an accept command?

Like, let's say you do /invite [playerid] I want it to send them a message with the option to /acceptinvite or /declineinvite. I'm using ZCMD & sscanf, how do I make this?

[INFO] - I just want to know what sort of format to do this in. Once you tell me/show me how to do this, I'll be able to do it forever.

Thanks!
Reply
#2

Anybody got some assistance to give me with this?
Reply
#3

pawn Код:
// /invite [id]
// id is in the variable userid.
// Check if the player has been invited already, so invites will not overwrite.
if(GetPVarInt(userid, "FactionID") != 0)
    return 1;

// Set the variable FactionID to the user selected.
SetPVarInt(userid, "FactionID", factionid);

// /acceptinvite
// Check the variable "FactionID" with GetPVar().
// If it exists or it is not zero, then the player has been invited.
// If so, when the command is sent, set him into the FactionID variable.
if(GetPVarInt(playerid, "FactionID") == 0)
    return 1;

// Set him into the faction.
var[playerid][faction] = GetPVarInt(playerid, "FactionID");

// Feel free to add a notification message.
SendClientMessage([...]);

// Always remember to delete temporary variables when you don't need them anymore.
DeletePVar(playerid, "FactionID");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)