"Warning 209: function "CreateDynamicVehicle" should return a value."
#1

pawn Код:
stock CreateDynamicVehicle(playerid,modelid,type,color)
{
    new Float:x, Float:y, Float:z, Float:angle;
    for(new i = 0; i < sizeof(VehicleInfo); i++)
    {
          if(VehicleInfo[i][vOwned] == 0)
             {
                        GetPlayerPos(playerid,x,y,z);
                        GetPlayerFacingAngle(playerid,angle);
                        SendClientMessage(playerid,COLOR_WHITE,"vehicle created");
                        SendClientMessage(playerid,COLOR_WHITE,"dont forget /editveh.");
                        VehicleInfo[i][vOwned] = 1;
                        VehicleInfo[i][vModel] = modelid;
                        VehicleInfo[i][vType] = type;
                        VehicleInfo[i][vColorOne] = color;
                        VehicleInfo[i][vColorTwo] = 0;
                        VehicleInfo[i][vX] = x;
                        VehicleInfo[i][vY] = y;
                        VehicleInfo[i][vZ] = z;
                        VehicleInfo[i][vAngle] = angle;
                        return 1;
                    }
                return 1;
                }
            }
please help
Reply
#2

pawn Код:
stock CreateDynamicVehicle(playerid,modelid,type,color)
{
    new Float:x, Float:y, Float:z, Float:angle;
    for(new i = 0; i < sizeof(VehicleInfo); i++)
    {
        if(VehicleInfo[i][vOwned] == 0)
        {
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,angle);
            SendClientMessage(playerid,COLOR_WHITE,"vehicle created");
            SendClientMessage(playerid,COLOR_WHITE,"dont forget /editveh.");
            VehicleInfo[i][vOwned] = 1;
            VehicleInfo[i][vModel] = modelid;
            VehicleInfo[i][vType] = type;
            VehicleInfo[i][vColorOne] = color;
            VehicleInfo[i][vColorTwo] = 0;
            VehicleInfo[i][vX] = x;
            VehicleInfo[i][vY] = y;
            VehicleInfo[i][vZ] = z;
            VehicleInfo[i][vAngle] = angle;
            return 1;
        }
    }
    return true;
 }
Reply
#3

Quote:
Originally Posted by SmiT
Посмотреть сообщение
pawn Код:
stock CreateDynamicVehicle(playerid,modelid,type,color)
{
    new Float:x, Float:y, Float:z, Float:angle;
    for(new i = 0; i < sizeof(VehicleInfo); i++)
    {
        if(VehicleInfo[i][vOwned] == 0)
        {
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,angle);
            SendClientMessage(playerid,COLOR_WHITE,"vehicle created");
            SendClientMessage(playerid,COLOR_WHITE,"dont forget /editveh.");
            VehicleInfo[i][vOwned] = 1;
            VehicleInfo[i][vModel] = modelid;
            VehicleInfo[i][vType] = type;
            VehicleInfo[i][vColorOne] = color;
            VehicleInfo[i][vColorTwo] = 0;
            VehicleInfo[i][vX] = x;
            VehicleInfo[i][vY] = y;
            VehicleInfo[i][vZ] = z;
            VehicleInfo[i][vAngle] = angle;
            return 1;
        }
    }
    return true;
 }
thanks worked +1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)