23.10.2014, 16:51
(
Last edited by Crazydriver; 24/10/2014 at 08:55 AM.
)
Edited: Fixed it myself but thanks for trying tho !!
vehicle = CreateVehicle(402, 2165.2227,1402.4500,10.8203,146.6180, 0, 0, -1);
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;
}
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; }