/sendr /accept /denie
#1

i have made a send dm request cmd so if you want to dm then u send this but i cant get it where it wont let a player just do /accept to teleport themselves away can someone help

sendr cmd

Код:
dcmd_sendr(const playerid,const params[])
{
    new ID = strval(params);
    if(!strlen(params)) return SendClientMessage(playerid,RED,"Error: \"/sendr < ID>\".");
    SetPVarInt(ID, "Sendr", GetPVarInt(ID, "Sendr")+1);
    SendClientMessage(playerid,ORANGE,"You sent the request");
    SendClientMessage(ID,ORANGE,"ID %s has sent you a DM Request. /Accept id or /denie id");
	return 1;
}
accept cmd

Код:
dcmd_accept(const playerid,const params[])
{
	new ID = strval(params);
 	if(!strlen(params)) return SendClientMessage(playerid,RED,"Error: \"/accept < ID>\".");
	if(ID == playerid) return SendClientMessage(playerid, RED, "You cannot dm yourself!");
 	if(GetPVarInt(playerid, "Sendr") == 1); SendClientMessage(playerid, RED, "You havent been sent a dm request!");
 	SetPVarInt(ID, "Sendr", GetPVarInt(ID, "Sendr")-1);
	SetPlayerPos(playerid,1532.3898,-1353.6200,329.4535);
	SetPlayerPos(ID,1555.9983,-1353.6331,329.4609);
	SendClientMessage(playerid,ORANGE,"You accepted! If you win type /kill to spawn back!");
	SendClientMessage(ID,ORANGE,"He accepted! If you win type /kill to spawn back!");
    
    return 1;
}
denie cmd

Код:
dcmd_denie(const playerid,const params[])
{
    new ID = strval(params);
    if(ID == playerid) return SendClientMessage(playerid, RED, "You cannot denie yourself!");
    SetPVarInt(ID, "Sendr", GetPVarInt(ID, "Sendr")+1);
    SendClientMessage(playerid,ORANGE,"You denied!");
    SendClientMessage(ID,ORANGE,"He denied");
    return 1;
}
thx
Reply
#2

Hi. I used tables and scanf.

Top of the gamemode:
Код:
new invite[MAX_PLAYERS];
In OnPlayerCommandText add:
Код:
dcmd(sendr, 5 ,cmdtext);
sandr:

Код:
dcmd_sendr(playerid, cmdtext[])
{
 	new id,string[80];

 	if (sscanf(cmdtext, "u", id))
	{

 	SendClientMessage(playerid, RED, "Error: /sendr [ID]");
 	return 1;

	}
        invite[id] = 1;
        SendClientMessage(playerid,ORANGE,"You sent the request");

        format(string, sizeof(string), "ID %s has sent you a DM Request. /Accept id or /denie id", YourFunction(playerid));
        SendClientMessage(id,ORANGE,string);
 	return 1;

}
The rest I do not want to do .
Reply
#3

thx for the help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)