new RandomSpawn = random(3); //3 Random spawns
if (RandomSpawn == 0)
{
SetPlayerPos(playerid, ....); //1st Spawn
}
if (RandomSpawn == 1)
{
SetPlayerPos(playerid, ....); //2nd Spawn
}
if (RandomSpawn == 2)
{
SetPlayerPos(playerid, ....); // 3rd Spawn
}
Originally Posted by [SE
FeaR ]
pawn Код:
pawn Код:
|
switch(RandomSpawn)
{
case 0:
{
SetPlayerPos( ... );
}
case 1:
{
SetPlayerPos( ... );
}
case 2:
{
SetPlayerPos( ... );
}
}
new RandomSpawn = random(7);
if (RandomSpawn == 0)
{
SetPlayerPos(playerid,1314.9265,1274.5889,10.8203);
}
if (RandomSpawn == 1)
{
SetPlayerPos(playerid,2593.3086,2825.2039,27.8203);
}
if (RandomSpawn == 2)
{
SetPlayerPos(playerid,2689.9150,2790.7878,59.0212);
}
if (RandomSpawn == 3)
{
SetPlayerPos(playerid,2725.5459,2682.5300,59.0234);
}
if (RandomSpawn == 4)
{
SetPlayerPos(playerid,2605.4829,2714.0332,25.8222);
}
if (RandomSpawn == 5)
{
SetPlayerPos(playerid,2693.7769,2696.0540,22.9472);
}
if (RandomSpawn == 6)
{
SetPlayerPos(playerid,2505.3228,2687.8430,74.8281);
}
if (RandomSpawn == 7)
{
SetPlayerPos(playerid,2631.9949,2835.0886,94.0156);
}
new Float:gRandomSpawns[][4] = { {x,y,z,a}, {x,y,z,a}, {x,y,z,a} };
new r=random(sizeof(gRandomSpawns)); SetPlayerPos(playerid,gRandomSpawns[0],gRandomSpawns[1],gRandomSpawns[2]); SetPlayerFacingAngle(playerid,gRandomSpawns[3]);
Originally Posted by NaS
or:
Код:
new Float:gRandomSpawns[][4] = { {x,y,z,a}, {x,y,z,a}, {x,y,z,a}, {x,y,z,a} }; Код:
new r=random(sizeof(gRandomSpawns)); SetPlayerPos(playerid,gRandomSpawns[0],gRandomSpawns[1],gRandomSpawns[2]); SetPlayerFacingAngle(playerid,gRandomSpawns[3]); |
if(strcmp(cmdtext, "/sniperdm", true) == 0)
{
new RandomSpawn = random(7);
if (RandomSpawn == 0)
{
SetPlayerPos(playerid,1314.9265,1274.5889,10.8203);
}
if (RandomSpawn == 1)
{
SetPlayerPos(playerid,2593.3086,2825.2039,27.8203);
}
if (RandomSpawn == 2)
{
SetPlayerPos(playerid,2689.9150,2790.7878,59.0212);
}
if (RandomSpawn == 3)
{
SetPlayerPos(playerid,2725.5459,2682.5300,59.0234);
}
if (RandomSpawn == 4)
{
SetPlayerPos(playerid,2605.4829,2714.0332,25.8222);
}
if (RandomSpawn == 5)
{
SetPlayerPos(playerid,2693.7769,2696.0540,22.9472);
}
if (RandomSpawn == 6)
{
SetPlayerPos(playerid,2505.3228,2687.8430,74.8281);
}
if (RandomSpawn == 7)
{
SetPlayerPos(playerid,2631.9949,2835.0886,94.0156);
}
GivePlayerWeapon(playerid, 38, 99999999); //
GivePlayerWeapon(playerid, 38, 99999999); ///// Place Weapons here<<
GivePlayerWeapon(playerid, 38, 99999999);//
SendClientMessage(playerid,0x00AFFFAA, "Welcome to the Sniper Deathmatch!");
return 1;
}
Originally Posted by [SE
FeaR ]
Here's an example: pawn Код:
|
C:\Documents and Settings\Dezi\Desktop\Mil Freeroam\gamemodes\MilFreeroam.pwn(2856) : warning 219: local variable "RandomSpawn" shadows a variable at a preceding level C:\Documents and Settings\Dezi\Desktop\Mil Freeroam\gamemodes\MilFreeroam.pwn(2852) : warning 204: symbol is assigned a value that is never used: "RandomSpawn" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.