Spawn Point bug with SCRP script
#4

I have command which is changing the spawn point, here it is.

pawn Код:
CMD:spawnpoint(playerid, params[])
{
    new point;
    if(sscanf(params, "i", point)) return SendErrorMessage(playerid, "/spawnpoint [0-2] (0 = Airport, 1 = Faction, 2 = Last logged)");
    if(point == 0)
    {
        SendClientMessage(playerid, COLOR_WHITE, "You've changed your spawn point to airport.");
        PlayerData[playerid][pSpawnPoint] = 0;
        return 1;
    }
    if(point == 1)
    {
        if(PlayerData[playerid][pFactionID] == -1)
        {
            SendErrorMessage(playerid, "You're not apart of a faction.");
            return 1;
        }
        SendClientMessage(playerid, COLOR_WHITE, "You've changed your spawn to faction.");
        PlayerData[playerid][pSpawnPoint] = 1;
        return 1;
    }
    if(point == 2)
    {
        SendClientMessage(playerid, COLOR_WHITE, "You've changed your spawn to your last logged off.");
        PlayerData[playerid][pSpawnPoint] = 2;
        return 1;
    }
    return 1;
}

Command for setting faction spawn
pawn Код:
CMD:fspawn(playerid, params[])
{
    new faction = PlayerData[playerid][pFactionID];

    if (PlayerData[playerid][pFaction] == -1)
        return SendErrorMessage(playerid, "You must be a faction leader.");

    if (PlayerData[playerid][pFactionRank] < FactionData[PlayerData[playerid][pFaction]][factionRanks] - 5)
        return SendErrorMessage(playerid, "You must be at least rank %d.", FactionData[PlayerData[playerid][pFaction]][factionRanks] - 5);
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    FactionData[faction][SpawnX] = X;
    FactionData[faction][SpawnY] = Y;
    FactionData[faction][SpawnZ] = Z;
    FactionData[faction][SpawnInterior] = GetPlayerInterior(playerid);
    FactionData[faction][SpawnVW] = GetPlayerVirtualWorld(playerid);
    Faction_Save(faction);
    SendClientMessage(playerid, COLOR_ORANGE, "You have changed your faction's spawn point. Faction members are now going to spawn here.");
    return 1;
}
Reply


Messages In This Thread
Spawn Point bug with SCRP script - by benjaminjones - 03.05.2016, 23:24
Re: Spawn Point bug with SCRP script - by benjaminjones - 04.05.2016, 12:03
Re: Spawn Point bug with SCRP script - by Nin9r - 04.05.2016, 12:12
Re: Spawn Point bug with SCRP script - by benjaminjones - 04.05.2016, 13:55
Re: Spawn Point bug with SCRP script - by benjaminjones - 06.05.2016, 13:20
Re: Spawn Point bug with SCRP script - by Dayrion - 06.05.2016, 13:36
Re: Spawn Point bug with SCRP script - by GoldenLion - 06.05.2016, 14:11
Re: Spawn Point bug with SCRP script - by benjaminjones - 08.05.2016, 04:10
Re: Spawn Point bug with SCRP script - by Ritzy2K - 08.05.2016, 04:13
Re: Spawn Point bug with SCRP script - by Sew_Sumi - 08.05.2016, 04:55

Forum Jump:


Users browsing this thread: 1 Guest(s)