Empty Staement???
#1

Hy guys.... What's the function to check empty statement ?

Like:
I have a var CreatedVehicles[10];

wanna check if CreatedVehicles[9] is empty

PHP код:
CMD:getcveh(playerid,params[])
{
    if(
P_Var[playerid][p_Adminlevel] > 0)
    {
    new 
id,FloatPos[3];
    if(
sscanf(params,"u",id))
    return 
SendClientMessage(playeridC_GREY"Format: /Getveh [vehicle id]");
    else
    
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
    
SetVehiclePos(CreatedVehicles[id],Pos[0],Pos[1],Pos[2]);
    }
    else {
    
SendClientMessage(playerid,C_GRAD,"You are not authorized to use this command!");
    }
    return 
1;

Now in above cmd...I wanna CreatedVehicles[id], as its empty I tped to 0,0,0 coords.
Reply
#2

PHP код:
CMD:getcveh(playerid,params[])
{
    if(
P_Var[playerid][p_Adminlevel] == 0) return SendClientMessage(playerid,C_GRAD,"You are not authorized to use this command!");
    new 
id,FloatPos[3];
    if(
sscanf(params,"u",id)) return SendClientMessage(playeridC_GREY"Format: /Getveh [vehicle id]");
    
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
    
SetVehiclePos(CreatedVehicles[id],Pos[0],Pos[1],Pos[2]);
    return 
1;

Try this.
Reply
#3

Oh no.... I wanna check if CreatedVehicles[id] is assigned to a veh or not ?
Reply
#4

Oh I got you:

PHP код:
CMD:getcveh(playerid,params[])
{
    if(
P_Var[playerid][p_Adminlevel] == 0) return SendClientMessage(playerid,C_GRAD,"You are not authorized to use this command!");
    new 
id,FloatPos[3];
    if(
sscanf(params,"u",id)) return SendClientMessage(playeridC_GREY"Format: /Getveh [vehicle id]");
    if(
GetVehicleModel(CreatedVehicles[id]) < 400 || GetVehicleModel(CreatedVehicles[id]) > 600) return SendClientMEssage(playeridC_GREY"Non exisitig vehicle.");
    
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
    
SetVehiclePos(CreatedVehicles[id],Pos[0],Pos[1],Pos[2]);
    return 
1;

Reply
#5

pawn Код:
stock IsVehicleConnected(vehicleid)
{
    new Float:x,Float:y,Float:z;
    GetVehiclePos(vehicleid,x,y,z);
    if(x==0.0 && y==0.0 && z==0.0) return 0;
    return 1;
}
No need to use "CreatedVehicles" variable.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)