02.12.2011, 02:11
ok so i create:
then
in theory in my head when a new car is created, 1 is added to the variable 'vcarcheck'
so then if another one is created the variable will be already 1 and it wont be created.
doesnt work though -.-
and im going to make another command to destroy the car, and to destroy it on log out, time out etc.
help ?
PHP код:
new vcarcheck = 0;
PHP код:
new color1;
new color2;
new car;
if(IsPlayerConnected(playerid))
{
if(gPlayerData[playerid][VIP] >= 1 || IsPlayerAdmin(playerid))
{
if ( sscanf( params, "iii", car, color1, color2 ) ) return SendClientMessage( playerid, COLOR_RED, "USAGE: {FFFF00}/vspawn [carID] [color1] [color2]" );
if(car < 400 || car > 611)
{
SendClientMessage(playerid, COLOR_RED, " Vehicle Number can't be below 400 or above 611 !"); return 1;
}
if(color1 < 0 || color1 > 160)
{
SendClientMessage(playerid, COLOR_RED, " Color Number can't be below 0 or above 160 !"); return 1;
}
if(color2 < 0 || color2 > 126)
{
SendClientMessage(playerid, COLOR_RED, " Color Number can't be below 0 or above 160 !"); return 1;
}
if (vcarcheck >= 1)
{
SendClientMessage(playerid, COLOR_RED, " Only One vspawn Car May Be Spawned At Any One Time "); return 1;
}
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
CreateVehicle(car, X,Y+2,Z, 0.0, color1, color2, 60000);
SendClientMessage(playerid, COLOR_RED, " Vehicle created.");
(vcarcheck += 1);
}
so then if another one is created the variable will be already 1 and it wont be created.
doesnt work though -.-
and im going to make another command to destroy the car, and to destroy it on log out, time out etc.
help ?