SA-MP Forums Archive
Spawn cmd - 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 cmd (/showthread.php?tid=457113)



Spawn cmd - Sliceofdeath - 09.08.2013

How to make a spawn cmd like , When we do /spawn at a place we will be spawned at that place.

Like i did /spawn at a place and came after sometime and did SPAWN [While skin time] so we will be spawned at place where we did /spawn not place where random spawns are made.

and even after getting killed also we will spawn at place where we have made /spawn


Re: Spawn cmd - Sliceofdeath - 09.08.2013

BUMP


Re: Spawn cmd - Originality - 09.08.2013

This should work: http://pastebin.com/0Fv4rGjh


Re: Spawn cmd - Sliceofdeath - 09.08.2013

Errors.

XYZ:\games\server\EF\gamemodes\EF(8008) : error 017: undefined symbol "team"
XYZ:\games\server\EF\gamemodes\EF(8011) : error 017: undefined symbol "X"


Re: Spawn cmd - SsHady - 09.08.2013

Edit:
its best if you see and Implement on this tutorial
Tutorial


Re: Spawn cmd - Sliceofdeath - 09.08.2013

Quote:
Originally Posted by SsHady
Посмотреть сообщение
post the code from 8000 to 8020
From OnPlayerSpawn till 8020

pawn Код:
public OnPlayerSpawn(playerid)
{
    Spawned[playerid] = 1;
    TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);
    SetPlayerPos(playerid,834.964,-2040.216,12.867);
    InDM[playerid] = 0;
    new Random = random(sizeof(RandomSpawns));
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    SetPlayerInterior(playerid, 0);
    SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
    GameTextForPlayer(playerid,"~g~Waiting for the Objects to load",2000,3);
    return 1;
}
CMD:spawn(playerid, params[])
{
        if(Spawned[playerid] == 0)
        {
                SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
                SpawnPlayer(playerid);
        }
        else SetPlayerPos(playerid, X, Y, Z);
        return 1;
}
CMD:rw(playerid, params[])
{
    InDM[playerid] = 1;
    SendClientMessage(playerid, -1, "{66FF66}Welcome to Running Weapons DM {BABABA}(SawnOff - Uzi)");
    SetPlayerInterior(playerid, 1);
    SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377);
    ResetPlayerWeapons(playerid);



Re: Spawn cmd - Konstantinos - 09.08.2013

It was just copied from the wiki:
pawn Код:
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
You should assign values to it. Same goes for:
pawn Код:
else SetPlayerPos(playerid, X, Y, Z);
I assume it was just an example of him and he let you to replace them with the coordinates and all that you want.


Re: Spawn cmd - Sliceofdeath - 09.08.2013

XY:\games\server\EF\gamemodes\EF(8008) : error 029: invalid expression, assumed zero
XY:\games\server\EF\gamemodes\EF(8008) : error 017: undefined symbol "X"
XY:\games\server\EF\gamemodes\EF(8011) : error 017: undefined symbol "X"


Re: Spawn cmd - Konstantinos - 09.08.2013

https://sampwiki.blast.hk/wiki/SetSpawnInfo
https://sampwiki.blast.hk/wiki/SetPlayerPos


Re: Spawn cmd - Sliceofdeath - 09.08.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Better i don't add /spawn in the server.
Cause wiki don't teach me anything -.-''