Need help finishing /afk and /back commands
#1

So i'v the /afk works fine, but how can i make it so when a player types /back it respawns them back into a random spawn point and they can keep playings

Random spawn points cords.
Код:
{-1931.8972, 353.8917, 33.3985, 90.9442},
    {-1952.7057, 368.0967, 35.9688, 91.8842},
    {-1952.0062, 400.9029,35.9688, 125.4112}
Pastebin - http://pawn.pastebin.com/AViymiK9
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/afk", true))
    {
    SetupPlayerForClassSelection(playerid);
    TogglePlayerControllable(playerid, 0);
	return 1;
    }
    if(!strcmp(cmdtext, "/back", true))
    {
    TogglePlayerControllable(playerid, 1);
    new rand = random(sizeof(RandomSpawn));
    SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
    SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
	return 1;
    }
    return 0;
    }
if anybody could help me it would i would be very thankful
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)