SA-MP Forums Archive
Spawn with dialogs problem [rep] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Spawn with dialogs problem [rep] (/showthread.php?tid=315295)



Spawn with dialogs problem [rep] - smokeweed - 02.02.2012

I've made a team & class selection in dialogs, now I will give the player spawn locations. I used this code:
pawn Код:
case DIALOG_SOLDIER:
        {
            if( response )
             if(gTeam[playerid] == TEAM_USA)
             {
                gPlayerClass[playerid] = SOLDIER_CLASS;
                AddPlayerClass(0,-251.3996,2602.4814,62.8582,6.5801,0,0,0,0,0,0);
                GivePlayerWeapon(playerid, 4, 1);//knife
                GivePlayerWeapon(playerid, 16, 2);//grenades
                GivePlayerWeapon(playerid, 24, 15);//desert eagle
                GivePlayerWeapon(playerid, 31, 60);//m4
                GivePlayerWeapon(playerid, 26, 15);//sawn off shotgun
                GivePlayerWeapon(playerid, 29, 30);//mp5
                SetPlayerHealth(playerid, 75);
                return 1;
            }
            else if(gTeam[playerid] == TEAM_EURO)
            {
                gPlayerClass[playerid] = SOLDIER_CLASS;
                AddPlayerClass(0,-204.5513,1090.3835,19.7422,314.8796,0,0,0,0,0,0);
                GivePlayerWeapon(playerid, 4, 1);//knife
                GivePlayerWeapon(playerid, 16, 2);//grenades
                GivePlayerWeapon(playerid, 24, 15);//desert eagle
                GivePlayerWeapon(playerid, 31, 60);//m4
                GivePlayerWeapon(playerid, 26, 15);//sawn off shotgun
                GivePlayerWeapon(playerid, 29, 30);//mp5
                SetPlayerHealth(playerid, 75);
                return 1;
            }
I'll want to spawn with the ''Play'' button in my dialog. How to do that?


Re: Spawn with dialogs problem [rep] - kubz777 - 02.02.2012

I don't think it is possible, however you can be able to make it so that when they click spawn, you can make their screen all black, and then make a dialogue that is nothing except "play".


Re: Spawn with dialogs problem [rep] - thimo - 02.02.2012

Use SpawnPlayer(playerid, X, Y, Z);


Re: Spawn with dialogs problem [rep] - smokeweed - 03.02.2012

Okayy I have this:
pawn Код:
case DIALOG_SOLDIER:
        {
            if( response )
             if(gTeam[playerid] == TEAM_USA)
             {
                gPlayerClass[playerid] = SOLDIER_CLASS;
                SpawnPlayer(playerid, -251.3996,2602.4814,62.8582);
                GivePlayerWeapon(playerid, 4, 1);//knife
                GivePlayerWeapon(playerid, 16, 2);//grenades
                GivePlayerWeapon(playerid, 24, 15);//desert eagle
                GivePlayerWeapon(playerid, 31, 60);//m4
                GivePlayerWeapon(playerid, 26, 15);//sawn off shotgun
                GivePlayerWeapon(playerid, 29, 30);//mp5
                SetPlayerHealth(playerid, 75);
                return 1;
            }
public OnPlayerRequestClass(playerid, classid)
{
    SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0); // Without this you'll be kicked when you spawn. Set it to wherever you want.
   
    return 1;
}
the spawning is working, but the coords are not working. I spawn every time on the same place. What to do?