16.07.2009, 21:05
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:
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; } |