Vehicle Not Spawning !!
#1

Edited: Fixed it myself but thanks for trying tho !!
Reply
#2

I'm not sure about this, but try to change your vehicle color to something else:
Code:
vehicle = CreateVehicle(402, 2165.2227,1402.4500,10.8203,146.6180, 0, 0, -1);
Reply
#3

Nope it didn't work can anybody help ??
Reply
#4

Bump i need help please
Reply
#5

Have you double-checked the position?
Reply
#6

Quote:
Originally Posted by Patrik356b
View Post
Have you double-checked the position?
Yes i have !!
Reply
#7

Try it

pawn Code:
if(strcmp(text, "1", true) == 0 && UserStats[playerid][Spawned] == 1 && ActiveMenu[playerid][Autobahn] == 1) //
{
    new
        VehicleID
    ;

    if(RecentPurchasedCar[playerid] >= 1)
        return SendClientMessage(playerid,COLOR_RED,"You Have Recently Purchased A Vehicle, Please Wait.");

    if(PlayerCash[playerid] < 50000)
        return SendClientMessage(playerid,COLOR_RED,"You Do Not Have Enough Money To Buy A Buffalo!");

    VehicleID = CreateVehicle(402, 2165.2227,1402.4500,10.8203,146.6180, -1, -1, -1);

    SendClientMessage(playerid,COLOR_YAY,"You Have Purchased A Buffalo Vehicle For $50000 From Autobahn, Enjoy!");
    PlayerCash[playerid] -= 50000;
    GameTextForPlayer(playerid,"~w~Purchased A ~p~Buffalo",5000,4);

    BoughtVehicle[vehicle] = 1;

    RecentPurchasedCar[playerid] = 60;
    HideBox(playerid);
    return 1;
}
Reply
#8

Use this include.. it might help you..
Code:
stock LoadDynamicObjectsFrom(filename[])
{
        new count = GetTickCount();
        new string[512],objectid,Float:pos[6],index,var_from_line[64],loaded;
        new File:example = fopen(filename, io_read);
        if(!example)return printf("Error opening: %s",filename);
        while(fread(example, string) > 0)
        {
                if(IsObjectCode(string))
                {
                        if(ClearLine(string))
                        {
                                index = 0;
                                index = token_by_delim(string,var_from_line,',',index); objectid = strval(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[0] = floatstr(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[1] = floatstr(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[2] = floatstr(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[3] = floatstr(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[4] = floatstr(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[5] = floatstr(var_from_line);
                                CreateDynamicObject(objectid,pos[0],pos[1],pos[2],pos[3],pos[4],pos[5]);
                                loaded++;
                        }
                }
        }
        fclose(example);
        return printf("Loaded %d objects. In %d mc.",loaded,(GetTickCount()-count));
}
stock ClearLine(line[])
{
        strdel(line, 0, 20);
        return 1;
}
forward bool:IsObjectCode(line[]);
stock bool:IsObjectCode(line[])
{
        if(strfind(line, "CreateDynamicObject", false) != -1)return true;
        return false;
}
stock token_by_delim(const string[], return_str[], delim, start_index)
{
    new x=0;
    while(string[start_index] != EOS && string[start_index] != delim) {
        return_str[x] = string[start_index];
        x++;
        start_index++;
    }
    return_str[x] = EOS;
    if(string[start_index] == EOS) start_index = (-1);
    return start_index;
}
For more information http://forum.sa-mp.com/showthread.ph...highlight=load

If i helped you, than please +REP me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)