OnPlayerSpawn stopping?
#1

Here's the code that initiates the OnPlayerSpawn code..

public RoundControl
pawn Код:
public RoundControl()
{
    new string[128];
    if(global_RoundStarted == 0) {
        new roundType;
        roundType = minrand(1, 3);
        if(roundType == 1) {
            global_RoundType = "Free for All";
            print("[script] Round Type 'Free for All' selected.");
            format(string, sizeof(string), "hostname The Elimination Server: Free for All");
            SendRconCommand(string);
        }
        else if(roundType == 2) {
            global_RoundType = "Team Deathmatch";
            print("[script] Round Type 'Team Deathmatch' selected.");
            format(string, sizeof(string), "hostname The Elimination Server: Team Deathmatch");
            SendRconCommand(string);
        }
        KillTimer(RoundTimer);
        global_RoundStarted = 0;
        print("[script] Timer 'RoundTimer' killed.");
        RoundTimer = SetTimer("RoundControl", round_TimeLimit, 1);
        global_RoundStarted = 1;
        print("[script] Timer 'RoundTimer' started.");
    }
    else if(global_RoundStarted == 1) {
        //Code for restarting the round from a time limit being reached.
    }
    return 1;
}
public GameModeInit
pawn Код:
public OnGameModeInit()
{
    djson_GameModeInit();
    SetGameModeText("Elimination v1");
    SetTimer("ThreeSecondTimer", 3000, 1);
    for(new i = 0; i <= 299; i++)
    {
        if(IsInvalidSkin(i)) continue;
        AddPlayerClass(i, 130.8830,-68.6318,1.5781,208.4004,0,0,0,0,0,0);
    }
    RoundControl();
    return 1;
}
public OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
    new string[128];
    if(strcmp(global_RoundType, "Free for All")) {
        format(string, sizeof(string), "You are currently playing a %s!", global_RoundType);
        SendClientMessage(playerid, sc_Lime, string);
    }
    else if(strcmp(global_RoundType, "Team Deathmatch")) {
        format(string, sizeof(string), "You are currently playing a %s!", global_RoundType);
        SendClientMessage(playerid, sc_Lime, string);
        new RandomTeam = minrand(1, 2);
        if(RandomTeam == 1) {
            SetPVarInt(playerid, "Team", 1);
            global_TeamPlayers1++;
            SendClientMessage(playerid, sc_White, "You have been randomly placed on Team 1!");
        }
        else if(RandomTeam == 2) {
            SetPVarInt(playerid, "Team", 2);
            global_TeamPlayers2++;
            SendClientMessage(playerid, sc_White, "You have been randomly placed on Team 2!");
        }
    }
    return 1;
}
What's wrong? The SendClientMessage on OnPlayerSpawn is not working at all.
Reply


Messages In This Thread
OnPlayerSpawn stopping? - by Sky4D - 03.09.2010, 02:55
Re: OnPlayerSpawn stopping? - by bigcomfycouch - 03.09.2010, 03:12
Re: OnPlayerSpawn stopping? - by Sky4D - 03.09.2010, 03:29
Re: OnPlayerSpawn stopping? - by Backwardsman97 - 03.09.2010, 05:23

Forum Jump:


Users browsing this thread: 1 Guest(s)