PDA

View Full Version : HELP with RANDOMSPAWN |helping +rep


kloning1
18/03/2014, 11:14 AM
i have problem sir, can you helping me? +rep

new Float:RSpawns[][] =
{
{1036.6963,1020.6562,11.0000,311.5801}, // Randomspawn
{-1246.2953,6.3236,14.1484,137.3114}, // Randomspawn
{-2026.4314,146.3436,28.8359,280.2547}, // Randomspawn
{-2648.4033,-30.6703,6.1328,179.8240}, // Randomspawn
{1197.1364,-2036.9879,69.0078,270.6776} // Randomspawn
};

public OnGameModeInit()
{
AddPlayerClass(skins[random(7)],RSpawns[random][0], RSpawns[random][1], RSpawns[random][2]);
};


than, i get errors

C:\Users\Mas O\Documents\Server\gamemodes\D.pwn(1223) : error 017: undefined symbol "RSpawns"
C:\Users\Mas O\Documents\Server\gamemodes\D.pwn(1223) : error 076: syntax error in the expression, or invalid function call
C:\Users\Mas O\Documents\Server\gamemodes\D.pwn(1223) : error 029: invalid expression, assumed zero
C:\Users\Mas O\Documents\Server\gamemodes\D.pwn(1223) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


please help me :( :( :cry:

SPA
18/03/2014, 11:29 AM
Random spawn using under onplayerspawn
like:

SetPlayerPos(playerid, RandomPlayerSpawns[rand][0], RandomPlayerSpawns[rand][1], RandomPlayerSpawns[rand][2]);

I dont know but maybe also undergamemodeinit.

for(new i = 29; i < 299; i++)
{
if(IsValidSkin(i))
{
AddPlayerClass(skins[random(7)],RSpawns[random][0], RSpawns[random][1], RSpawns[random][2]);
}
}

kloning1
18/03/2014, 12:10 PM
sir, I've added like what you teach
but, so like this when spawn
http://prntscr.com/31w1swhttp://prntscr.com/31w1sw

VishvaJeet
18/03/2014, 12:53 PM
new spawn=random(12);
switch(spawn)
{
case 0: SetPlayerPos(playerid, .......);
case 1: add more spawns total 12 spawns
}

VenomMancer
18/03/2014, 02:29 PM
cobain ini :

new Float:RSpawns[5][3] =
{
{1036.6963,1020.6562,11.0000}, // Randomspawn
{-1246.2953,6.3236,14.1484}, // Randomspawn
{-2026.4314,146.3436,28.8359}, // Randomspawn
{-2648.4033,-30.6703,6.1328}, // Randomspawn
{1197.1364,-2036.9879,69.0078} // Randomspawn
};

public OnGameModeInit()
{
new rand = random(sizeof(gRandomPlayerSpawns));
AddPlayerClass(skins[random(7)],RSpawns[rand][0], RSpawns[rand][1], RSpawns[rand][2]);
};

kloning1
18/03/2014, 03:41 PM
cobain ini :

new Float:RSpawns[5][3] =
{
{1036.6963,1020.6562,11.0000}, // Randomspawn
{-1246.2953,6.3236,14.1484}, // Randomspawn
{-2026.4314,146.3436,28.8359}, // Randomspawn
{-2648.4033,-30.6703,6.1328}, // Randomspawn
{1197.1364,-2036.9879,69.0078} // Randomspawn
};

public OnGameModeInit()
{
new rand = random(sizeof(gRandomPlayerSpawns));
AddPlayerClass(skins[random(7)],RSpawns[rand][0], RSpawns[rand][1], RSpawns[rand][2]);
};

hmm, eror jg mas~
nih pic nya~
http://prntscr.com/31xj9g
# http://prntscr.com/31xj9g

ATomas
18/03/2014, 03:44 PM
new Float:RSpawns[5][3] =
{
{1036.6963,1020.6562,11.0000}, // Randomspawn
{-1246.2953,6.3236,14.1484}, // Randomspawn
{-2026.4314,146.3436,28.8359}, // Randomspawn
{-2648.4033,-30.6703,6.1328}, // Randomspawn
{1197.1364,-2036.9879,69.0078} // Randomspawn
};

public OsPlayerSpawn(playerid)
{
new rand = random(sizeof(RSpawns));
SetPlayerPos(playerid,RSpawns[rand][0], RSpawns[rand][1], RSpawns[rand][2]);
return 1;
}

VenomMancer
19/03/2014, 05:27 AM
hmm, eror jg mas~
nih pic nya~
http://prntscr.com/31xj9g
# http://prntscr.com/31xj9g

Errornya post aja disini!

HolyScripter
19/03/2014, 11:56 AM
new Float:RSpawns[5][3] =
{
{1036.6963,1020.6562,11.0000}, // Randomspawn
{-1246.2953,6.3236,14.1484}, // Randomspawn
{-2026.4314,146.3436,28.8359}, // Randomspawn
{-2648.4033,-30.6703,6.1328}, // Randomspawn
{1197.1364,-2036.9879,69.0078} // Randomspawn
};

public OnPlayerSpawn(playerid)
{
new rand = random(sizeof(RSpawns));
SetPlayerPos(playerid,RSpawns[rand][0], RSpawns[rand][1], RSpawns[rand][2]);
return 1;
}
Kalau mau bikin random spawn bikinnya di onplayerspawn bkan di ongamemodeinit

Hanuman
19/03/2014, 12:05 PM
new Float:RSpawns[5][3] =
{
{1036.6963,1020.6562,11.0000,311.5801}, // Randomspawn
{-1246.2953,6.3236,14.1484,137.3114}, // Randomspawn
{-2026.4314,146.3436,28.8359,280.2547}, // Randomspawn
{-2648.4033,-30.6703,6.1328,179.8240}, // Randomspawn
{1197.1364,-2036.9879,69.0078,270.6776} // Randomspawn

};

stock SetRSpawnsPos(playerid)
{
if( gTeam[playerid]== /*your team */ ) {
new rand = random(sizeof(RSpawns));
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, RSpawns[rand][0], RSpawns[rand][1], RSpawns[rand][2]);
}
return 1;
}

public OnPlayerSpawn(playerid)
{
SetRSpawnsPos(playerid);
return 1;
}

helpfull?