Nabend sa-mp.de
ich habe ein problem mit meinem robsystem unzwar führt er garnichts aus heißt wenn ich an den bestimmten stellen /rob mache passiert garnix
woran kann das liegen mein robsystem kommt von gf-suchtis.
Einmal der normale befehl /rob
if(strcmp(cmd,"/rob", true)==0)
{
if(IsPlayerConnected(playerid))
{
if(rob[playerid] != 0)
{
PlayerRobbing(playerid);
return 1;
}
if(!IsACop(playerid))
{
if(rob[playerid] == 0) { PlayerRobbing(playerid); }
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Du bist ein Cop!");
}
}
return 1;
}
Da ist einmal der public der alles ausführt:
public PlayerRobbing(playerid)
{
if(rob[playerid] == 5)
{
rob[playerid] = 0;
return 1;
}
if(rob[playerid] != 0)
{
new job, vdd, vbb;
if(PlayerInfo[playerid][pMember] > 0)
{
job = PlayerInfo[playerid][pMember];
}
else if(PlayerInfo[playerid][pLeader]>0)
{
job = PlayerInfo[playerid][pLeader];
}
if(job != 0)
{
if(job == 5 || job == 6 || job == 8 || job == 12 || job == 13 || job == 14 || job == 15 || job == 19)
{
//for(new idd; idd<GangZone;idd++)
//{
//if(GangZone[idd][owner] == job)
//{
vdd++;
//}
//}
}
else
{
vdd = 10;
}
}
else
{
vdd = 10;
}
if(vdd != 10)
{
if(vdd < 10)
{
vbb = -(vdd*25);
}
else
{
vbb = (vdd-10)*25;
}
}
if(rob[playerid] == 1) { ConsumingMoney[playerid] = 1; GivePlayerMoney(playerid, rob_cash_tankstelle+vbb); SendClientMessage(playerid, COLOR_ORANGE, "Du hast die Tankstelle erfolgreich ausgeraubt"); }
if(rob[playerid] == 2) { ConsumingMoney[playerid] = 1; GivePlayerMoney(playerid, rob_cash_bank+vbb); SendClientMessage(playerid, COLOR_ORANGE, "Du hast die Bank erfolgreich ausgeraubt"); }
if(rob[playerid] == 3) { ConsumingMoney[playerid] = 1; GivePlayerMoney(playerid, rob_cash_store+vbb); SendClientMessage(playerid, COLOR_ORANGE, "Du hast den Laden erfolgreich ausgeraubt"); }
rob[playerid] = 0;
TogglePlayerControllable(playerid, 1);
return 1;
}
gettime(hour, minute);
if(hour >= 0 && hour < 8) { SendClientMessage(playerid, COLOR_ORANGE, "Zu diesem Zeitpunkt kannst du nicht rauben"); return 1; }
for (new i; i < MAX_ROB_PLACES; i++)
{
if(PlayerToPoint(Robplace_Rad[i], playerid, Robplace_X[i], Robplace_Y[i], Robplace_Z[i]))
{
if(Robplace_Robbed[i] == 0)
{
if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_ORANGE, "Du kannst nicht vom Auto aus rauben"); return 1; }
if(GetPlayerWeapon(playerid) == 0) { SendClientMessage(playerid, COLOR_ORANGE, "Du brauchst eine Waffe!"); return 1; }
new dutycops = 0;
for (new c; c<MAX_PLAYERS; c++)
{
if(IsACop(c))
{
if(OnDuty[code=c] == 1 || PlayerInfo[code=c][pMember] == 1 || PlayerInfo[code=c][pMember] == 2 || PlayerInfo[code=c][pLeader] == 1 || PlayerInfo[code=c][pLeader] == 2 || PlayerInfo[code=c][pMember] == 3 || PlayerInfo[code=c][pMember] == 16 || PlayerInfo[code=c][pLeader] == 3 || PlayerInfo[code=c][pLeader] == 16)
{
dutycops++;
}
}
}
if(dutycops < 3)
{
SendClientMessage(playerid, COLOR_ORANGE, "Es müssen mindestens 3 Cops Online und Duty sein!");
return 1;
}
Robplace_Robbed[i] = 1;
SetTimerEx("UnlockRobPlace", 7200000, 0, "i", i);
TogglePlayerControllable(playerid, 0);
rob[playerid] = Robplace_Type[i];
if(Robplace_Type[i] == 1) { SetTimerEx("PlayerRobbing", rob_time_tankstelle, 0, "i", playerid); }
if(Robplace_Type[i] == 2) { SetTimerEx("PlayerRobbing", rob_time_bank, 0, "i", playerid); }
if(Robplace_Type[i] == 3) { SetTimerEx("PlayerRobbing", rob_time_store, 0, "i", playerid); }
new Float:x, Float:y, Float:z, city[256], string[256];
GetPlayerPos(playerid, x,y,z);
city = GetPlayerCity(playerid);
new string2[256];
for(new u; u < MAX_PLAYERS; u++)
{
if(IsACop(u))
{
if(Robplace_Type[i] == 1)
{
format(string, sizeof(string), "~w~Eine ~r~Tankstelle ~w~ in %s wird ~r~ausgeraubt", city);
GameTextForUser(u,string,string2, 5000, 1);
}
if(Robplace_Type[i] == 2)
{
format(string, sizeof(string), "~w~Eine ~r~Bank ~w~wird ~r~ausgeraubt");
GameTextForUser(u,string,string2, 5000, 1);
}
if(Robplace_Type[i] == 3)
{
format(string, sizeof(string), "~w~Ein ~r~Geschaeft ~w~ in %s wird ~r~ausgeraubt", city);
GameTextForUser(u,string,string2, 5000, 1);
}
SetPlayerCheckpoint(u, x, y, z, 5);
}
}
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "Hier wurde bereits geraubt!");
return 1;
}
}
}
return 1;
}
Die Punkte wo man robben kann
public DefineRobPlaces()
{
new idx = 0;
Robplace_X[idx] = 1939.4;
Robplace_Y[idx] = -1771.5;
Robplace_Z[idx] = 13.1; //LSPD
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 1;
Robplace_X[idx] = 1008.4;
Robplace_Y[idx] = -939.54;
Robplace_Z[idx] = 42.4; //BSN
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 2;
Robplace_X[idx] = 653.34;
Robplace_Y[idx] = -565.3;
Robplace_Z[idx] = 16.5; //Dillimore
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 3;
Robplace_X[idx] = 1382.6;
Robplace_Y[idx] = 460.9;
Robplace_Z[idx] = 20.1; //Montgomery
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 4;
Robplace_X[idx] = -91.9;
Robplace_Y[idx] = -1169.4;
Robplace_Z[idx] = 2.6; //RS Haul
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 5;
Robplace_X[idx] = 653.34;
Robplace_Y[idx] = -565.3;
Robplace_Z[idx] = 29.0; //Doherty
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 6;
Robplace_X[idx] = -1680.4;
Robplace_Y[idx] = 421.4;
Robplace_Z[idx] = 7.4; //SFPD
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 7;
Robplace_X[idx] = -2408.5;
Robplace_Y[idx] = 974.4;
Robplace_Z[idx] = 45.5; //SF Nord
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 8;
Robplace_X[idx] = -1472.1;
Robplace_Y[idx] = 1863.43;
Robplace_Z[idx] = 32.8; //Tierra Robada
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 9;
Robplace_X[idx] = 69.3;
Robplace_Y[idx] = 1215.2;
Robplace_Z[idx] = 18.6; //Fort Carson
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 10;
Robplace_X[idx] = 611.4;
Robplace_Y[idx] = 1695.1;
Robplace_Z[idx] = 6.7; //Große Tankstelle Desert - Ost
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 11;
Robplace_X[idx] = -1605.0;
Robplace_Y[idx] = -2714.5;
Robplace_Z[idx] = 48.3; //Angelpine 1
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 12;
Robplace_X[idx] = -2244.5;
Robplace_Y[idx] = -2560.1;
Robplace_Z[idx] = 31.7; //Angelpine 2
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 13;
Robplace_X[idx] = -736.2;
Robplace_Y[idx] = 2746.5;
Robplace_Z[idx] = 47.0; //Mini Tanke Pampa
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 14;
Robplace_X[idx] = -1329.1;
Robplace_Y[idx] = 2677.7;
Robplace_Z[idx] = 50.0; //Pampa Tanke
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 15;
Robplace_X[idx] = -2027.8;
Robplace_Y[idx] = 157.4;
Robplace_Z[idx] = 28.8; //Tanke BHF SF
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 1;
idx = 16;
Robplace_X[idx] = 1463.2;
Robplace_Y[idx] = -1012.6;
Robplace_Z[idx] = 26.8; //Bank LS
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 2;
idx = 17;
Robplace_X[idx] = -1784.6;
Robplace_Y[idx] = 570.9;
Robplace_Z[idx] = 35.1; //Bank SF
Robplace_Rad[idx] = 10;
Robplace_Robbed[idx] = false;
Robplace_Type[idx] = 2;
return 1;
}
und halt ein paar definierungen
wäre ziemlich nett wenn ihr mir helfen könnt ich habe keine ahnung sitze seit mehreren stunden dran und finde einfach nichts. =(
Lg
Rocc0w