SA-MP Forums Archive
On Death - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: On Death (/showthread.php?tid=222904)



On Death - Eichelking - 08.02.2011

How can i make when a player port to /dm and when he died on this zone that the spawn not on a base but on the /dm


AW: On Death - Nero_3D - 08.02.2011

use SetSpawnInfo

But if you set the position manual in OnPlayerSpawn you need an array which marks that he is in the deathmatch
And if he is than check in OnPlayerSpawn if he is and set his position correctly


Re: On Death - Eichelking - 08.02.2011

How can i make this? Sorry im a Noob


Re: On Death - XoX - 08.02.2011

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/dm", true))
    {
        SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
        //Params: (playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)

        return 1;
    }
}



Re: On Death - Eichelking - 08.02.2011

Sorry but how can i make this line to this:

Quote:

if(strcmp(cmdtext,"/dm",true)==0)
{
if(InDM[playerid]!=1)
{
InDM[playerid]++;
SendClientMessage(playerid,COLOR_GREEN,"Du hast die Deathmatch Zone betreten!");
new rand = random(sizeof(RandomSpawnsDM));
SetPlayerPos(playerid,RandomSpawnsDM[rand][0],RandomSpawnsDM[rand][1],RandomSpawnsDM[rand][2]);
GetPlayerPos(playerid,ppos[playerid][0],ppos[playerid][1],ppos[playerid][2]);
}




Re: On Death - XoX - 09.02.2011

I would do a var
Код:
new InDM[MAX_PLAYERS];
new rand = random(sizeof(RandomSpawnsDM));
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/dm", true))
    {
        InDM[playerid]=1;
        SetPlayerPos(playerid, ..., ..., ....)
        SendClientMessage(playerid,COLOR_GREEN,"Du hast die Deathmatch Zone betreten!");
        return 1;
    }
}
Код:
public OnPlayerSpawn(playerid)
{
    if (InDM[playerid] > 0)
    {
    SetPlayerPos(playerid, ..., ..., ....)
    return 1;
    }
}
Not tested. Sry if there're any errors my head is not working at morning.