Problem with car spawning command
#1

Hello!
I'm making a tournament, but I got into a problem. There's a command /vagis, which give player a car, but ONLY if the tournament is started.
The problem is that if if(stipnieks != 1) { is turned on 1, there's no meaning if tournament is started or not, I will get an message "Turnīrs vēl nav sācies", in english - tournament is not started yet, but if I turn it on 0, player can get an car even if the tournament is not started.
I try'd to fix it, but I fail'd.

There's the script:
Quote:

if (strcmp(cmdtext, "/vagis", true)==0) {
new Float:X, Float:Y, Float:Z, Float:Angle;
if(stipnieks != 0) {
return SendClientMessage(playerid, COLOR_GREY, "Turnirs vel nav sacies!");
}
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
if(carer[playerid] == 1) {
if(IsAnyPlayerInVehicle(Veh[playerid])) {
for(new i=0; i<GetMaxPlayers(); i++) {
if(GetPlayerVehicleID(i) == Veh[playerid]) {
RemovePlayerFromVehicle(i);
}
}
}
PutPlayerInVehicle(playerid, Veh[playerid], 0);
SetVehiclePos(Veh[playerid], X, Y, Z);
SetVehicleZAngle(Veh[playerid], Angle);
} else {
carer[playerid] = 1;
Veh[playerid] = CreateVehicle(583, X, Y, Z+50, Angle, Colors[random(sizeof Colors)], Colors[random(sizeof Colors)], 10000);
PutPlayerInVehicle(playerid, Veh[playerid], 0);
SetVehiclePos(Veh[playerid], X, Y, Z);
SetVehicleZAngle(Veh[playerid], Angle);
return 1;
}

Reply


Messages In This Thread
Problem with car spawning command - by Dominiks - 16.07.2009, 21:05
Re: Problem with car spawning command - by woot - 16.07.2009, 21:12
Re: Problem with car spawning command - by Dominiks - 16.07.2009, 21:16
Re: Problem with car spawning command - by refshal - 16.07.2009, 21:18
Re: Problem with car spawning command - by Dominiks - 16.07.2009, 21:26
Re: Problem with car spawning command - by refshal - 16.07.2009, 21:28
Re: Problem with car spawning command - by Dominiks - 16.07.2009, 21:37
Re: Problem with car spawning command - by refshal - 17.07.2009, 01:11
Re: Problem with car spawning command - by Dominiks - 17.07.2009, 06:27
Re: Problem with car spawning command - by woot - 17.07.2009, 07:02

Forum Jump:


Users browsing this thread: 1 Guest(s)