Szerző Téma: DM Spawn;  (Megtekintve 640 alkalommal)

dctom

  • Vendég
DM Spawn;
« Dátum: 2010. December 27. - 17:57:26 »
0 Show voters
Hali hogyan kell megoldani a DM be a véletlenszerû Spawnolást?  :neutral:
Itt van a DM 1 kis része ahova a spawnolást kell megcsinálni:
 
  case 0:
         {
         SetPlayerPos(playerid,2623.6,2758.1,23.8);
         SetPlayerPos(playerid,2666.7,2821.8,36.3);
         SetPlayerFacingAngle(playerid,90.0);
         SetPlayerColor(playerid,COLOR_GREY);
         ResetPlayerWeapons(playerid);
         GivePlayerWeapon(playerid,34,10);
         SetPlayerVirtualWorld(playerid,dmid[playerid]);
         }

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
DM Spawn;
« Válasz #1 Dátum: 2010. December 27. - 18:02:15 »
0 Show voters
1. Tömb
2. Véletlenszerûen kiválasztasz egyet a tömbtõl. :D
 

new Float:DMSpawn [ 2 ] [ 3 ] =
{
    {X, Y, Z},
    {X, Y, Z}
};

 


new rand = random ( 2 );
SetPlayerPos ( playerid, DMSpawn [ rand ] [ 0 ], DMSpawn [ rand ] [ 1 ], DMSpawn [ rand ] [ 2 ] );
« Utoljára szerkesztve: 2010. December 27. - 18:47:24 írta Brisk »

dctom

  • Vendég
DM Spawn;
« Válasz #2 Dátum: 2010. December 27. - 18:32:24 »
0 Show voters
Itt vmi nem jó, a tömböt mod elejére tettem:
 
new  DMSpawn [ ] [ ] =
{
    {2623.6,2758.1,23.8}, //221
    {2666.7,2821.8,36.3}, //222
    {2666.9,2734.9,14.2} //223
};

 
A spawnolást meg ide:
 

case 0:
         {
SetPlayerPos(playerid,DMSpawn[rand][0],DMSpawn[rand][1],DMSpawn [ rand][2],DMSpawn[rand][3]); //2167
         SetPlayerFacingAngle(playerid,90.0);
 SetPlayerColor(playerid,COLOR_GREY);
 ResetPlayerWeapons(playerid);
         GivePlayerWeapon(playerid,34,10);
         SetPlayerVirtualWorld(playerid,dmid[playerid]);
         }

 
És 1 error meg 1 csomó warning:
 
C:\\Documents and Settings\\USER\\Asztal\\szerver\\gamemodes\\GPV1.pwn(221) : warning 213: tag mismatch
C:\\Documents and Settings\\USER\\Asztal\\szerver\\gamemodes\\GPV1.pwn(221) : warning 213: tag mismatch
C:\\Documents and Settings\\USER\\Asztal\\szerver\\gamemodes\\GPV1.pwn(221) : warning 213: tag mismatch
C:\\Documents and Settings\\USER\\Asztal\\szerver\\gamemodes\\GPV1.pwn(222) : warning 213: tag mismatch
C:\\Documents and Settings\\USER\\Asztal\\szerver\\gamemodes\\GPV1.pwn(222) : warning 213: tag mismatch
C:\\Documents and Settings\\USER\\Asztal\\szerver\\gamemodes\\GPV1.pwn(222) : warning 213: tag mismatch
C:\\Documents and Settings\\USER\\Asztal\\szerver\\gamemodes\\GPV1.pwn(223) : warning 213: tag mismatch
C:\\Documents and Settings\\USER\\Asztal\\szerver\\gamemodes\\GPV1.pwn(223) : warning 213: tag mismatch
C:\\Documents and Settings\\USER\\Asztal\\szerver\\gamemodes\\GPV1.pwn(223) : warning 213: tag mismatch
C:\\Documents and Settings\\USER\\Asztal\\szerver\\gamemodes\\GPV1.pwn(2167) : error 032: array index out of bounds (variable \"DMSpawn\")
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
1 Error.

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
DM Spawn;
« Válasz #3 Dátum: 2010. December 27. - 18:48:07 »
0 Show voters
Bocsi, nem írtam be a tömb méretét.
http://sampforum.hu/index.php?topic=8808.0
« Utoljára szerkesztve: 2010. December 28. - 15:35:58 írta Brisk »

dctom

  • Vendég
DM Spawn;
« Válasz #4 Dátum: 2010. December 28. - 15:32:38 »
0 Show voters
Kössze  :)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal