10.03.2014, 16:56
I want to make me this commands in if(strcmp ...). /pos to get my coordonate , when i write /startfight , appear a message /join , and players write /join get him at my save coordonates of /pos.
new FightStarted = 0;
new Float:fight_x,
Float:fight_y,
Float:fight_z;
//Position save command
if (strcmp("/pos", cmdtext, true) == 0)
{
SendClientMessage(playerid, -1, "* Fight Position saved!");
GetPlayerPos(playerid, fight_x, fight_y, fight_z);
return 1;
}
//Startfight command
if (strcmp("/startfight", cmdtext, true) == 0)
{
if(FightStarted == 1) return SendClientMessage(playerid, -1, "* A fight was already started!");
new str[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(str, sizeof(str), "%s has started a fight! Type /join to join it!", pname);
SendClientMessageToAll(playerid, -1, str);
FightStarted = 1;
return 1;
}
//Join command
if (strcmp("/join", cmdtext, true) == 0)
{
if(FightStarted == 0) return SendClientMessage(playerid, -1, "* There is no active fight!");
SendClientMessage(playerid, -1, "* Joined the fight!");
SetPlayerPos(playerid, fight_x, fight_y, fight_z);
return 1;
}