SA-MP Forums Archive
Command sends message. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command sends message. (/showthread.php?tid=280370)



Command sends message. - davelord - 31.08.2011

Okay, can anyone give me a command, for example: /buttsecks [ID] <- It'll send the ID a message with: 'Hello, would you like to have buttsecks? Please type /accept or /cancel If they type /cancel, the sender will recieve a message that the guy denied his request, if accepted, the guy who accepted gets a hooker skin and a dildo.


Re: Command sends message. - Amel_PAtomAXx - 31.08.2011

pawn Код:
new Invited[MAX_PLAYERS];
if (strcmp(cmd,"/buttsecks",true)== 0)
    {
        if(!strlen(cmdtext[10]))
        {
            SendClientMessage(playerid, COLOR_GREY, "Usage: /buttsecks [playerid]");
            return 1;
        }
        new ID = strval(cmdtext[10);
        if(IsPlayerConnected(ID))
        {
                SendClientMessage(playerid,0xFFFFFFFF,"Invite sent.");
            SendClientMessage(ID,0xFFFFFFFF,"Hello, would you like to have buttsecks? Please type /accept or /cancel .");
                Invited[ID]= 1;
            }
        return 1;

    }
if(strcmp(cmd,"/accept",true)== 0)
{
    if(Invited[playerid] == 1)
    {
        GivePlayerWeapon(playerid, weaponid , ammo); // put dildo ID
        SetPlayerSkin(playerid,skinid); // put skin id
        Invited[playerid] = 0;
     }
      return 1;
}
if(strcmp(cmd,"/cancel",true)== 0)
{
    if(Invited[playerid]== 1)
    {
        Invited[playerid] = 0;
        SendClientMessage(playerid,0xFFFFFFFF,"You have canceled.");
    }
    return 1;
}



Re: Command sends message. - davelord - 31.08.2011

Thanks.