Hey Leute ich habe ein problem unzwar wenn ich /rob eingebe kommt immer Du bist in keinem Laden wo kann der fehler im Befehl liegen ?
if(strcmp(cmd, "/rob", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(cops[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE,"Du bist ein Cop!");
return 1;
}
for(new o=0; o<7200;o++)
{
if(PlayerToPoint(10.0,playerid,gbl_LX[o],gbl_LY[o],gbl_LZ[o]) && gbl_L[o] == GetPlayerVirtualWorld(playerid)+1)
{
SendClientMessage(playerid, COLOR_WHITE,"Dieser Laden wurde erst vor kurzem ausgeraubt!");
return 1;
}
}
if(cops_on < 0)
{
SendClientMessage(playerid, COLOR_WHITE,"Es sind zu wenig cops online.");
return 1;
}
if(GetPlayerWeapon(playerid) < 21 || GetPlayerWeapon(playerid) > 39)
{
SendClientMessage(playerid, COLOR_WHITE,"Der Besitzer fuerchtet sich nicht!\nDu musst ihn mit deiner Waffe bedrohen!");
return 1;
}
if(gbl_robber_status[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE,"Du bist bereits am ausrauben!");
return 1;
}
new str_msg[256], name[256];
GetPlayerName(playerid, name, sizeof(name));
if(IsAtGasStation(playerid) >= 2000)
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
}
ApplyAnimation(playerid,"SHOP", "ROB_Loop_Threat",4.0,1,0,0,0,0);
format(str_msg, sizeof(str_msg), "Eine Tankstelle wird ausgeraubt!", name);
gbl_robber_status[playerid] = 1;
TogglePlayerControllable(playerid, 0);
SetTimerEx("rob",60000,false,"i",playerid);
ruf(str_msg, playerid);
}
else if(IsAtBar(playerid) >= 500)
{
ApplyAnimation(playerid,"SHOP", "ROB_Loop_Threat",4.0,1,0,0,0,0);
if(PlayerToPoint(4.0,playerid,1215.9480,-13.3519,1000.9219))
{
format(str_msg, sizeof(str_msg), "Der PIG Pen wird ausgeraubt!", name);
}
else if(PlayerToPoint(4.0,playerid,495.7801,-76.0305,998.7578))
{
format(str_msg, sizeof(str_msg), "Eine Bar wird ausgeraubt!", name);
}
else if(PlayerToPoint(4.0,playerid,499.9654,-20.2515,1000.6797))
{
format(str_msg, sizeof(str_msg), "Eine Bar wird ausgeraubt!!", name);
}
else
{
format(str_msg, sizeof(str_msg), "Eine Bar wird ausgeraubt !", name);
}
gbl_robber_status[playerid] = 1;
TogglePlayerControllable(playerid, 0);
SetTimerEx("rob",30000,false,"i",playerid);
ruf(str_msg, playerid);
}
else if(IsAtClothShop(playerid) >= 500)
{
ApplyAnimation(playerid,"SHOP", "ROB_Loop_Threat",4.0,1,0,0,0,0);
format(str_msg, sizeof(str_msg), "Ein Geschaeft wird ausgeraubt!", name);
gbl_robber_status[playerid] = 1;
TogglePlayerControllable(playerid, 0);
SetTimerEx("rob",30000,false,"i",playerid);
ruf(str_msg, playerid);
}
else if(IsAtBankLS(playerid) == 20000)
{
format(str_msg, sizeof(str_msg), "Die Bank in Los Santos wird ausgeraubt!", name);
gbl_robber_status[playerid] = 1;
ApplyAnimation(playerid,"SHOP", "ROB_Loop_Threat",4.0,1,0,0,0,0);
SetTimerEx("rob",120000,false,"i",playerid);
ruf(str_msg, playerid);
}
else if(IsAtBankSF(playerid) == 20000)
{
format(str_msg, sizeof(str_msg), "Die Bank in San Fierro wird ausgeraubt!", name);
gbl_robber_status[playerid] = 1;
ApplyAnimation(playerid,"SHOP", "ROB_Loop_Threat",4.0,1,0,0,0,0);
SetTimerEx("rob",120000,false,"i",playerid);
ruf(str_msg, playerid);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du bist in keinem Laden!");
return 1;
}
}
return 1;
}