SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 13/01/2011, 11:13 PM   #1
Rokzlive
Gangsta
 
Rokzlive's Avatar
 
Join Date: Aug 2010
Location: Winder, GA USA
Posts: 577
Reputation: 12
Default Spawn Problems

Ok, my spawn points dont work.

I have 10 AddPlayerClass points, but when i login, it does not show them, and when i spawn, i spawn at the 0 0 0 default in blueberry. I even tried making a dialog spawn, you choose something and its sets your position, that does not work either.

I dont know what i did.

Please help.
__________________
================================
Nickolas C Shaffer
Hobbiest Pawn Coder
================================
Rokzlive is offline  
Old 13/01/2011, 11:19 PM   #2
Anthonyx3'
Gangsta
 
Anthonyx3''s Avatar
 
Join Date: Feb 2010
Location: Bronx ^^
Posts: 515
Reputation: 3
Default Re: Spawn Problems

Show your requestclass/onplayerspawn for more help?
__________________
Quote:
Originally Posted by Nexus RP Advertisement
"IP: 127.0.0.1:7777 (Working IP)"
"our Admins are not noobs too!"
Anthonyx3' is offline  
Old 13/01/2011, 11:26 PM   #3
Rokzlive
Gangsta
 
Rokzlive's Avatar
 
Join Date: Aug 2010
Location: Winder, GA USA
Posts: 577
Reputation: 12
Default Re: Spawn Problems

Classes
pawn Code:
AddPlayerClass(161,2118.0212,-2173.2434,18.5469,126.3903,0,0,0,0,0,0);
    AddPlayerClass(179,2829.9478,918.4404,10.7500,279.6504,0,0,0,0,0,0);
    AddPlayerClass(181,1681.0226,975.8158,10.7789,353.4319,0,0,0,0,0,0);
    AddPlayerClass(206,1069.5417,1268.4760,10.8203,176.1641,0,0,0,0,0,0);
    AddPlayerClass(248,-84.7425,-1126.5870,1.0781,266.0118,0,0,0,0,0,0);
    AddPlayerClass(260,-488.8553,-534.6000,25.5296,348.8983,0,0,0,0,0,0);
    AddPlayerClass(132,-2162.8982,-225.4068,36.5156,0.8460,0,0,0,0,0,0);
    AddPlayerClass(265,1568.39,-1691.35,5.89,126.3903,0,0,0,0,0,0);
    AddPlayerClass(266,-1616.66,684.16,7.19,126.3903,0,0,0,0,0,0);
    AddPlayerClass(267,2295.05,2459.06,10.82,126.3903,0,0,0,0,0,0);
    AddPlayerClass(7,2192.24,-2262.79,13.55,126.3903,0,0,0,0,0,0);
    AddPlayerClass(50,-1861.86,-145.30,11.89,126.3903,0,0,0,0,0,0);
    AddPlayerClass(16,2699.44,861.35,10.14,126.3903,0,0,0,0,0,0);

OnPlayerConnect
pawn Code:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    playerdata[playerid][allowteleport] = 0;
    playerdata[playerid][blockpm] = 0;
    playerdata[playerid][seepms] = 0;
    playerdata[playerid][playerwired] = 0;
    playerdata[playerid][level] = 0;
    playerdata[playerid][pWarnings]=0;
    playerdata[playerid][PlayerWired]=0;
    playerdata[playerid][logged] = 0;
    playerdata[playerid][Joins]=0;
    playerdata[playerid][Deaths]=0;
    playerdata[playerid][Kills]=0;
    playerdata[playerid][PlayerFrozen] = 0;
    playerdata[playerid][Kicks]=0;
    playerdata[playerid][vip]=0;
    playerdata[playerid][fines]=0;
    playerdata[playerid][mace]=0;
    playerdata[playerid][cigar]=0;
    playerdata[playerid][wine] = 0;
    playerdata[playerid][sprunk]=0;
    playerdata[playerid][beer]=0;
    playerdata[playerid][phone]=0;
    playerdata[playerid][disabled]=0;
    playerdata[playerid][warns]=0;
    playerdata[playerid][insured]=0;
    playerdata[playerid][slots]=0;
    playerdata[playerid][maxslots]=0;
    SetTimerEx("Save", 25000, true, "i", playerid);
    TextDrawShowForPlayer(playerid,ServerTimeTD);
    new pname[MAX_PLAYER_NAME], query[150];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(query, sizeof(query), "SELECT * FROM `accounts` WHERE `name` = '%s';", pname);
    mysql_query(query); mysql_store_result();

    if(mysql_num_rows() != 0)
    {
        format(s, sizeof(s), "{FFFF00}%s {FFFFFF}is registered.\nPlease {AA3333}Login.", pname);
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Please Login",s,"Login","Screw This");
    }
    else
    {
        format(s, sizeof(s),"{FFFF00}%s {FFFFFF}is {AA3333}not {FFFFFF}registered.\nPlease enter a password below.", pname);
        ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Please Register",s,"Register","Screw This");
    }
    mysql_free_result();
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        pSpectating[playerid][i]=0;
    }
    ranka[playerid] = Create3DTextLabel("Trucker",COLOR_YELLOW,30.0,40.0,50.0,40.0,0);
    rankb[playerid] = Create3DTextLabel("Dispatch",COLOR_GREEN,30.0,40.0,50.0,40.0,0);
    rankc[playerid] = Create3DTextLabel("Recovery",COLOR_RED,30.0,40.0,50.0,40.0,0);
    rankd[playerid] = Create3DTextLabel("Police",COLOR_BLUE,30.0,40.0,50.0,40.0,0);
    GameTextForPlayer(playerid,"~w~Rokzlive ~r~Transportation Nation",5000,5);
    SendClientMessage(playerid, COLOR_GREEN, "Welcome! Choose your spawn! Type /menu to learn how to use our server! Type /rules to see rules!");
    TextDrawShowForPlayer(playerid,Name);
    TextDrawShowForPlayer(playerid,Web);
    M_OnPlayerConnect(playerid);
    new string[100];
    format(string, sizeof(string),"To start a mission type /work");
    TextDrawShowForPlayer ( playerid, mission [ playerid ] );
    TextDrawSetString(mission [ playerid ],string);
//    SPEEDOS[playerid] = TextDrawCreate(10.0,200.0," ");
//  TextDrawShowForPlayer(playerid,SPEEDOS[playerid]);
    isloggedin[playerid] = 1;
    return 1;
}

OnPlayerRequestClass
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    if (playerdata[playerid][disabled] == 1)
    {
        SendClientMessage(playerid,red,"Your account is disabled!");
        Kick(playerid);
    }
    else if(classid == 1)
    GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
    else if (classid == 2)
    GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
    else if(classid == 3)
    GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
    else if (classid == 4)
    GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
    else if(classid == 5)
    GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
    else if (classid == 6)
    GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
    else if(classid == 7)
    GameTextForPlayer(playerid,"~b~Police", 3000, 3);
    else if(classid == 8)
    GameTextForPlayer(playerid,"~b~Police", 3000, 3);
    else if(classid == 9)
    GameTextForPlayer(playerid,"~b~Police", 3000, 3);
    else if (classid == 10)
    GameTextForPlayer(playerid,"~r~Recovery", 3000, 3);
    else if(classid == 11)
    GameTextForPlayer(playerid,"~r~Recovery", 3000, 3);
    else if (classid == 12)
    GameTextForPlayer(playerid,"~r~Recovery", 3000, 3);
    else if(classid == 13)
    GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
    return 1;
}
OnPlayerSpawn
pawn Code:
public OnPlayerSpawn(playerid)
{
    if(alreadyspawned[playerid] == 1)
    {
        new randInt = random ( 7 );
        switch ( randInt )
        {
            case 0: SetPlayerPos(playerid,2118.0212,-2173.2434,18.5469);
            case 1: SetPlayerPos(playerid,2829.9478,918.4404,10.7500);
            case 2: SetPlayerPos(playerid,1681.0226,975.8158,10.7789);
            case 3: SetPlayerPos(playerid,1069.5417,1268.4760,10.8203);
            case 4: SetPlayerPos(playerid,-84.7425,-1126.5870,1.0781);
            case 5: SetPlayerPos(playerid,-488.8553,-534.6000,25.5296);
            case 6: SetPlayerPos(playerid,-2162.8982,-225.4068,36.5156);
        }
        return 1;
    }
    SetPlayerPos(playerid, 2118.0212,-2173.2434,18.5469);
    SendClientMessage(playerid,COLOR_YELLOW, "Choose your class!");
    ShowPlayerDialog(playerid, 1000000, DIALOG_STYLE_LIST, "Spawn List", "Male Trucker\nFemale Trucker", "Spawn", "Cancel");
//  new classid=GetPlayerSkin(playerid);
    AntiDeAMX();
 // new string[100];
    SpawnMessage(playerid);
    SetPlayerInterior(playerid,0);
    TogglePlayerClock(playerid,0);
    SendClientMessage(playerid, COLOR_YELLOW,"Note: Use /money to see how much money you have!");
    SetPlayerMoney(playerid, playerdata[playerid][money]);
    SetPlayerScore(playerid, playerdata[playerid][score]);
    return 1;
}
__________________
================================
Nickolas C Shaffer
Hobbiest Pawn Coder
================================
Rokzlive is offline  
Old 13/01/2011, 11:31 PM   #4
Kitten
High-roller
 
Join Date: Jul 2010
Location: United States
Posts: 2,169
Reputation: 345
Default Re: Spawn Problems

pawn Code:
if(alreadyspawned[playerid] == 1)
    {
        new randInt = random ( 7 );
        switch ( randInt )
        {
            case 0: SetPlayerPos(playerid,2118.0212,-2173.2434,18.5469);
            case 1: SetPlayerPos(playerid,2829.9478,918.4404,10.7500);
            case 2: SetPlayerPos(playerid,1681.0226,975.8158,10.7789);
            case 3: SetPlayerPos(playerid,1069.5417,1268.4760,10.8203);
            case 4: SetPlayerPos(playerid,-84.7425,-1126.5870,1.0781);
            case 5: SetPlayerPos(playerid,-488.8553,-534.6000,25.5296);
            case 6: SetPlayerPos(playerid,-2162.8982,-225.4068,36.5156);
        }
        return 1;
    }

why u setting the position again after the random?
Kitten is offline  
Old 13/01/2011, 11:38 PM   #5
Rokzlive
Gangsta
 
Rokzlive's Avatar
 
Join Date: Aug 2010
Location: Winder, GA USA
Posts: 577
Reputation: 12
Default Re: Spawn Problems

Its something i tried since the spawn was not working.
__________________
================================
Nickolas C Shaffer
Hobbiest Pawn Coder
================================
Rokzlive is offline  
Old 13/01/2011, 11:44 PM   #6
Kitten
High-roller
 
Join Date: Jul 2010
Location: United States
Posts: 2,169
Reputation: 345
Default Re: Spawn Problems

try this http://wiki.sa-mp.com/wiki/Random
Kitten is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with my /spawn command Jonni8 Help Archive 19 23/07/2010 10:27 PM
[Help] Object/item ectra spawn on player spawn? No-Half-Measures Help Archive 3 21/01/2010 09:38 AM
Spawn problems hanzen Help Archive 2 13/07/2009 09:13 PM
Spawn Problems! romeotheboss Help Archive 1 13/04/2009 06:42 PM


All times are GMT. The time now is 03:16 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.