11.02.2011, 16:07
(
Последний раз редактировалось Michael@Belgium; 12.02.2011 в 09:17.
Причина: SOLVED
)
hi everyone, i need a random spawn, i mean it's not working...
I have this:
(1) Random spawn [SOLVED]
It's a code from my derby server, so it's with a round timer.
At this if the rounds end, i don't go to another position im staying at the same place.
And i think too ... not everyone is going to the same place, i mean if the rounds end then they all have to go to map 1 ...
(2) Player falls in water ... dead
When a player (maybe with car) falls into the water he's dead: this don't work too:
(under InGameModeInit)
(3) Player with highest car health wins the round ! (ERROR) [SOLVED]
THE ERRORS:
(4) If round is in progress, the spawned player has to spectate
BTW this don't work too :S
If the round is in progress the ppl has to see someone/the admin. I want random spectate ... idk how to do that.
With this script the player don't see the ppl who plays, you can only see random place in SA
I hope someone can help (a)
I have this:
(1) Random spawn [SOLVED]
It's a code from my derby server, so it's with a round timer.
pawn Код:
new OtherSpawn = random(3);
switch (OtherSpawn)
{
case 0:
{
SetPlayerPos(playerid, 1369.2378,2195.9094,9.7578);
TogglePlayerSpectating(playerid, 0);
}
case 1:
{
SetPlayerPos(playerid, 2897.8269,529.6500,2.5237);
TogglePlayerSpectating(playerid, 0);
}
case 2:
{
SetPlayerPos(playerid, -1164.3026,-927.6463,129.2188);
TogglePlayerSpectating(playerid, 0);
}
}
And i think too ... not everyone is going to the same place, i mean if the rounds end then they all have to go to map 1 ...
(2) Player falls in water ... dead
When a player (maybe with car) falls into the water he's dead: this don't work too:
(under InGameModeInit)
pawn Код:
new Float:x, Float:y, Float:z;
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerPos(i, x, y, z);
if(z < -2) //maybe the coord is wrong :S
{
SetPlayerHealth(i, 0.0);
}
}
pawn Код:
new Float:max = 0.00; //line 1174
new winner = -1;
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
new Float:h;
GetVehicleHealth(GetPlayerVehicleID(i),h);
if(h > max)
{
max = h;
winner = i;
}
}
}
}
if(winner != -1)
{
new name[MAX_PLAYER_NAME], string[80]; //line 1196
GetPlayerName(winner,name,sizeof(name));
format(string,sizeof(string),"%s's vehicle has the most health and won this round",name);
SendClientMessageToAll(COLOR_WHITE,string);//or whatever color you need
}
Код:
C:\Users\Michael\Desktop\GTA\Eigen server\gamemodes\derby1.pwn(1174) : warning 219: local variable "max" shadows a variable at a preceding level C:\Users\Michael\Desktop\GTA\Eigen server\gamemodes\derby1.pwn(1196) : warning 219: local variable "string" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.
BTW this don't work too :S
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(gTeam[playerid] == DERBYMEMBER)
{
if(EndRoundCounter != 0)
{
SetPlayerPos(playerid, 1377.2653,2209.4810,17.6797);
SendClientMessage(playerid, COLOR_RED,"Sorry, you can't join while the round is in progress, you have to wait ...");
SendClientMessage(playerid, COLOR_ORANGE,"While you have to wait, you can specate the ADMIN !");
GameTextForPlayer(playerid, "~y~Round in progress ...", 1250, 3);
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, 0);
}
}
return 1;
}
With this script the player don't see the ppl who plays, you can only see random place in SA
I hope someone can help (a)