Astea nu le-am folosit deloc in sistem, da nu stiu de ce imi da acolo eroare, am folosit setint, setvw, si multe altele, va dau aici tot
if(BusinessRob[playerid] > 0) fail_rob(playerid);
function SpargeUsa(playerid) {
SetPlayerPosEx(playerid, 965.8165, -53.2116, 1001.1133);
SetPlayerInterior(playerid, 3);
// unfreeze
rob_objects[playerid][0] = CreatePlayerObject(playerid, 18872, 967.16199, -45.37270, 1000.95020, 0.00000, 0.00000, 0.00000);
rob_objects[playerid][1] = CreatePlayerObject(playerid, 19422, 967.13727, -48.06918, 1000.94995, 0.00000, 0.00000, 0.00000);
rob_objects[playerid][2] = CreatePlayerObject(playerid, 1518, 960.81970, -57.32470, 1001.21222, 0.00000, 0.00000, -182.10001);
rob_objects[playerid][3] = CreatePlayerObject(playerid, 19893, 957.55756, -54.16825, 1001.05933, 0.00000, 0.00000, -286.61993);
rob_objects[playerid][4] = CreatePlayerObject(playerid, 19578, 957.12683, -52.68953, 1001.05994, 0.00000, 0.00000, 0.00000);
return 1;
}
function destroy_rob_objects(playerid) {
for(new i = 0; i < 5; i++) {
if (rob_objects[playerid][id] != 0) DestroyPlayerObject(playerid, rob_objects[playerid][id]), rob_objects[playerid][id] = 0;
}
return 1;
}
function destroy_rob_object_id(playerid, id) {
if (rob_objects[playerid][i] != 0) DestroyPlayerObject(playerid, rob_objects[playerid][i]), rob_objects[playerid][i] = 0;
total_objects[playerid] ++;
if(total_objects[playerid] == 3) {
destroy_rob_objects(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
new rand = random(3);
if(rand == 0) rob_vehicle[playerid] = CreateVehicle(482, 802.3189, -609.5759, 16.2697, 0.0000, -1, -1, 100);
if(rand == 1) rob_vehicle[playerid] = CreateVehicle(482, 783.8732, -1138.0397, 23.6983, -91.6800, -1, -1, 100);
if(rand == 2) rob_vehicle[playerid] = CreateVehicle(482, 993.1291, -1383.4227, 13.1841, 0.0000, -1, -1, 100);
PutPlayerInVehicleEx(playerid, rob_vehicle[playerid], 0);
BusinessRob[playerid] = 2;
RobTime[playerid] = 0;
new rand2 = random(sizeof(gRandomRob));
SetPlayerCheckpoint(playerid, gRandomRob[rand2][0],gRandomRob[rand2][1],gRandomRob[rand2][2], 4.0);
SendClientMessage(playerid, COLOR_ROB,"Mergi la checkpoint-ul de pe minimap pentru a ascunde banii furati.");
return 1;
}
function fail_rob(playerid) {
DestroyVehicle(rob_vehicle[playerid]);
PlayerTextDrawHide(playerid, RobPTD);
DisablePlayerCheckpoint(playerid);
BusinessRob[playerid] = 0;
RobTime[playerid] = -1;
SendClientMessage(playerid, COLOR_ROB, "Rob failed. You died.");
return 1;
}
// fail daca iese din veh
CMD:rob(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need level 3 to do this.");
if(PlayerInfo[playerid][pWantedLevel] > 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You can't rob a business when you have wanted.");
if(PlayerInfo[playerid][pRob] >= 10 && PlayerInfo[playerid][pPremiumAccount] == 0 || PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pPremiumAccount] == 0|| PlayerInfo[playerid][pRob] >= 8 && PlayerInfo[playerid][pPremiumAccount] > 0)
{
if(IsACop(playerid)) return SCM(playerid,COLOR_WHITE,"{FFB870}You're a cop.");
for(new i = 1; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
SetTimerEx("SpargeUsa", 5000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~asteapta sa spargi usa", 5000, 4);
BusinessRob[playerid] = 3;
if(PlayerInfo[playerid][pPremiumAccount] == 0)
{
PlayerInfo[playerid][pRob] -= 10;
}
else if(PlayerInfo[playerid][pPremiumAccount] == 1)
{
PlayerInfo[playerid][pRob] -= 8;
}
Update(playerid,pRobx);
total_objects[playerid] = 0;
rob_time[playerid] = 180;
PlayerTextDrawSetString(playerid, RobPTD, "loading...");
PlayerTextDrawShow(playerid, RobPTD);
// virtualworld pe id casa
// freeze
}
}
}
else
{
if(PlayerInfo[playerid][pPremiumAccount] == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You don't have 10 rob points.");
}
else if(PlayerInfo[playerid][pPremiumAccount] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You don't have 8 rob points.");
}
return 1;
}
rob_time[i] --;
format(string, sizeof(string), "objects: %d/3~n~time left: %s", total_objects[i], CalculeazaTimp2(rob_time[i]));
PlayerTextDrawSetString(i, RobPTD, string);
PlayerTextDrawShow(i, RobPTD);
if(rob_time[i] == 0) {
PlayerTextDrawHide(i, RobPTD);
SetPlayerWantedLevel(i, 6);
PlayerTextDrawShow(i, WantedText[i]);
new str1[256];
format(str1,sizeof(str1),"WANTED SCADE IN: ~r~%d MINUTE",wantedlost[i]/60+1);
PlayerTextDrawSetString(i, WantedText[i], str1);
WantedPoints[i] = 12;
SetPlayerCriminal(i,255, "armed robbery");
Update(i,pWantedLevelx);
DestroyDynamic3DTextLabel(WantedScris[i]);
Tigaanel[i] = 1;
new str2[256];
format(str2,sizeof(str2),"{FF00FF}Wanted Level: %d", PlayerInfo[i][pWantedLevel]);
WantedScris[i] = CreateDynamic3DTextLabel(str2, COLOR_WHITE, 0,0, -20, 20, i);
Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, WantedScris[i] , E_STREAMER_ATTACH_OFFSET_Z, 0.48);
if(UsedFind[i] == 1)
{
UsedFind[i] = 0;
DisablePlayerCheckpoint(i);
foreach(Player, x)
{
if(IsACop(x))
{
if(caser[x] == x)
{
cased[x] --;
caser[x] = 1001;
}
}
}
}
}
}