Creating a Slap command & >>> more... -
L0zaix - 17.02.2012
Hello, once again i'm creating my admin system.
i'm assign to make /slap command yeah i know how
but how can i make player position set to higher position just like luxadmin "/slap" command.
and not only that.
How can if the playerid i put in the /slap command is higher administrator?
Thanks - L0zaix
Re: Creating a Slap command & >>> more... -
KingHual - 17.02.2012
Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(givenid, x, y, z);
SetPlayerPos(givenid, x, y, z+5);
Re: Creating a Slap command & >>> more... -
L0zaix - 17.02.2012
Quote:
Originally Posted by king_hual
Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(givenid, x, y, z);
SetPlayerPos(givenid, x, y, z+5);
|
One question how to check if the playerid i put in /slap command is a higher administrator
and Thanks. gonna test it
Re: Creating a Slap command & >>> more... -
L0zaix - 17.02.2012
there is one problem when i try slap my self i teleport to NPC Jorge (actually i have 5 npc)
i don't know why. here is the code this is tested. this code has warning and not done yet.
pawn Код:
CMD:slap(playerid, params[])
{
new Float:x, Float:y, Float:z;
new string[128],
pname[MAX_PLAYER_NAME],
victimname[MAX_PLAYER_NAME],
victimid,
reason[30];
GetPlayerPos(victimid, x, y, z);
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(victimid, victimname, sizeof(victimname));
if(PlayerInfo[playerid][Admin] > 3)
{
if(sscanf(params, "us[30]", victimid, reason)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /slap <playerid/name> <reason>");
if(IsPlayerNPC(victimid)) return SendClientMessage(playerid, COLOR_RED, "You cannot slap NPC Bots!");
if(victimid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid-Playerid!");
SetPlayerPos(victimid, x, y, z+5);
}
else return SendClientMessage(playerid, COLOR_RED, "You must be Administrator Level 3 or higher to use this command!");
return 1;
}
how to prevent it?
Re: Creating a Slap command & >>> more... -
L0zaix - 17.02.2012
someone?
Re: Creating a Slap command & >>> more... -
milanosie - 17.02.2012
Use sccanf before getting pos
Re: Creating a Slap command & >>> more... -
L0zaix - 17.02.2012
what do you mean?
Re: Creating a Slap command & >>> more... -
milanosie - 17.02.2012
Place the getpos and stuff BELOW the if(!sscanf. Part
Re: Creating a Slap command & >>> more... -
L0zaix - 17.02.2012
thanks it work! Topic Solved!
Re: Creating a Slap command & >>> more... -
milanosie - 17.02.2012
I hope u understand ur mistake, any new thing is setted to 0 unless defined else, sscanf defines it to the players id