Connect error
#1

This happends only the first time the player spawns...

so you need to kill yourself instead.

check the attachment to see what I mean
Reply
#2

Did you do SetPlayerInterior to 0 when player spawns and connect? This looks like he is spawn in a interior, but wrong coordinates
Reply
#3

Here it is

pawn Код:
public OnPlayerSpawn(playerid){
    if(IsPlayerNPC(playerid))
    {
        SetPlayerColor(playerid,0xffaa5533);
    }
    new randSpawn = 0;

    if(CITY_LOS_SANTOS == gPlayerCitySelection[playerid]) {
        randSpawn = random(sizeof(gRandomSpawns_LosSantos));
        SetPlayerPos(playerid,
         gRandomSpawns_LosSantos[randSpawn][0],
         gRandomSpawns_LosSantos[randSpawn][1],
         gRandomSpawns_LosSantos[randSpawn][2]);
        SetPlayerFacingAngle(playerid,gRandomSpawns_LosSantos[randSpawn][3]);
    }
    else if(CITY_SAN_FIERRO == gPlayerCitySelection[playerid]) {
        randSpawn = random(sizeof(gRandomSpawns_SanFierro));
        SetPlayerPos(playerid,
         gRandomSpawns_SanFierro[randSpawn][0],
         gRandomSpawns_SanFierro[randSpawn][1],
         gRandomSpawns_SanFierro[randSpawn][2]);
        SetPlayerFacingAngle(playerid,gRandomSpawns_SanFierro[randSpawn][3]);
    }
    else if(CITY_LAS_VENTURAS == gPlayerCitySelection[playerid]) {
        randSpawn = random(sizeof(gRandomSpawns_LasVenturas));
        SetPlayerPos(playerid,
         gRandomSpawns_LasVenturas[randSpawn][0],
         gRandomSpawns_LasVenturas[randSpawn][1],
         gRandomSpawns_LasVenturas[randSpawn][2]);
        SetPlayerFacingAngle(playerid,gRandomSpawns_LasVenturas[randSpawn][3]);
    }
    GivePlayerWeapon(playerid,WEAPON_COLT45,100);
    GivePlayerWeapon(playerid,WEAPON_MP5,100);

   
    return 1;
}
Reply
#4

Fixed, sorry anyway how can I create a command whcih does a countdown? but DON'T freezes all the players?
Reply
#5

Credits to 2KY for making this.
pawn Код:
#include <a_samp>

new
    p_Countdown[MAX_PLAYERS] = 30;
   
forward CountingDown(playerid);
public CountingDown(playerid)
{
    switch(p_Countdown[playerid])
    {
        case 30: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 29: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 28: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 27: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 26: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 25: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 24: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 23: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 22: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 21: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 20: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 19: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 18: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 17: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 16: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 15: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 14: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 13: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 12: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 11: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 10: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 9: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 8: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 7: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 6: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 5: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 4: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 3: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 2: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 1: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 0: //The end.
        {
            GameTextForPlayer(playerid, "~g~Go!", 3, 100);
            p_Countdown[playerid] = 30;
            TogglePlayerControllable(playerid, 1); //Unfreeze them.
            SendClientMessage(playerid, 0xFFFFFFFF, "Go!");
        }
    }
    p_Countdown[playerid]--;
    return true;
}

//Put this in your command to start this.
SetTimerEx("CountingDown", 1000, true, "i", playerid);
Reply
#6

Quote:
Originally Posted by Affan
Посмотреть сообщение
Credits to 2KY for making this.
pawn Код:
#include <a_samp>

new
    p_Countdown[MAX_PLAYERS] = 30;
   
forward CountingDown(playerid);
public CountingDown(playerid)
{
    switch(p_Countdown[playerid])
    {
        case 30: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 29: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 28: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 27: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 26: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 25: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 24: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 23: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 22: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 21: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 20: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 19: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 18: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 17: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 16: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 15: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 14: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 13: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 12: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 11: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 10: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 9: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 8: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 7: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 6: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 5: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 4: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 3: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 2: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 1: {
            GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
        }
        case 0: //The end.
        {
            GameTextForPlayer(playerid, "~g~Go!", 3, 100);
            p_Countdown[playerid] = 30;
            TogglePlayerControllable(playerid, 1); //Unfreeze them.
            SendClientMessage(playerid, 0xFFFFFFFF, "Go!");
        }
    }
    p_Countdown[playerid]--;
    return true;
}

//Put this in your command to start this.
SetTimerEx("CountingDown", 1000, true, "i", playerid);
I know I'm not but the command itself how I do it? O_o
Reply
#7

try that


pawn Код:
public OnPlayerSpawn(playerid){
    if(IsPlayerNPC(playerid))
    {
        SetPlayerColor(playerid,0xffaa5533);
    }
    new randSpawn = 0;

    if(CITY_LOS_SANTOS == gPlayerCitySelection[playerid]) {
        randSpawn = random(sizeof(gRandomSpawns_LosSantos));
        SetPlayerPos(playerid,
         gRandomSpawns_LosSantos[randSpawn][0],
         gRandomSpawns_LosSantos[randSpawn][1],
         gRandomSpawns_LosSantos[randSpawn][2]);
        SetPlayerInterior(playerid, 0);
        SetPlayerFacingAngle(playerid,gRandomSpawns_LosSantos[randSpawn][3]);
    }
    else if(CITY_SAN_FIERRO == gPlayerCitySelection[playerid]) {
        randSpawn = random(sizeof(gRandomSpawns_SanFierro));
        SetPlayerPos(playerid,
         gRandomSpawns_SanFierro[randSpawn][0],
         gRandomSpawns_SanFierro[randSpawn][1],
         gRandomSpawns_SanFierro[randSpawn][2]);
        SetPlayerInterior(playerid, 0);
        SetPlayerFacingAngle(playerid,gRandomSpawns_SanFierro[randSpawn][3]);
    }
    else if(CITY_LAS_VENTURAS == gPlayerCitySelection[playerid]) {
        randSpawn = random(sizeof(gRandomSpawns_LasVenturas));
        SetPlayerPos(playerid,
         gRandomSpawns_LasVenturas[randSpawn][0],
         gRandomSpawns_LasVenturas[randSpawn][1],
         gRandomSpawns_LasVenturas[randSpawn][2]);
        SetPlayerInterior(playerid, 0);
        SetPlayerFacingAngle(playerid,gRandomSpawns_LasVenturas[randSpawn][3]);
    }
    GivePlayerWeapon(playerid,WEAPON_COLT45,100);
    GivePlayerWeapon(playerid,WEAPON_MP5,100);

   
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)