Morgen Breadfish:
Ein zufallsprinzio zeigt einem die Roote die er fahren soll?
Jedoch kann ich bei jeder Roote nur bei CP1 delivern?
if(strcmp(cmd, "/stuff", true) == 0)
{
if(PlayerInfo[playerid][pJob] == 20)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GOLD, "____________________________|Warenhilfe|____________________________");
SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /materials [Aktion] [Anzahl]");
SendClientMessage(playerid, COLOR_WHITE, "*get [SF], *deliver [Unterschiedlich] Anzahl[Die du dabei hast]");
SendClientMessage(playerid, COLOR_GOLD,"__________________________________________________________________");
return 1;
}
if(strcmp(tmp,"get",true) == 0)
{
if(PlayerInfo[playerid][pBootsmann] >> 20)
{
SendClientMessage(playerid, COLOR_GRAD1, "Du hast schon 20 Waren dabei!");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 15.0, -1440.6125,390.9183,-0.0725))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GOLD, "____________________________|Warenhilfe|____________________________");
SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /materials [Aktion] [Anzahl]");
SendClientMessage(playerid, COLOR_WHITE, "Du hast die Anzahl vergessen");
SendClientMessage(playerid, COLOR_GOLD,"__________________________________________________________________");
return 1;
}
if(PlayerInfo[playerid][pBootsmann] <= 20)
{
if(PlayerInfo[playerid][pBootsmann] >= 20)
{
SendClientMessage(playerid, COLOR_GRAD1, "Du hast schon 20 Waren dabei!");
return 1;
}
new message[128];
new menge;
new BootsmannJames = random(2)+ 1;
menge = strval(tmp);
new preis = menge*100;
if(menge < 1 || menge > 20) { SendClientMessage(playerid, COLOR_GREY, "Du kannst maximal 20 Pakete mitnehmen !"); return 1; }
GivePlayerMoney(playerid,-preis);
PlayerInfo[playerid][pBootsmann] += menge;
format(message, sizeof(message), "* Du hast %d Materials Pakete für $%d gekauft.", menge, preis);
SendClientMessage(playerid,WHITE,message);
if(BootsmannJames == 1)
{
SetPlayerCheckpoint(playerid,-644.2157,861.9647,-0.1699,3.0);
genaueAZ[playerid] = 1;
CP1[playerid] = 1;
SendClientMessage(playerid,WHITE,"Route 1");
//genaueAZ[playerid] = 1;
return 1;
}
if(BootsmannJames == 2)
{
SetPlayerCheckpoint(playerid,-854.0779,1380.6956,-0.1582,3.0);
CP1[playerid] = 1;
genaueAZ[playerid] = 1;
SendClientMessage(playerid,WHITE,"Route 2");
//genaueAZ[playerid] = 1;
return 1;
}
/*if(BootsmannJames == 3)
{
SetPlayerCheckpoint(playerid,-1445.6111,1506.9808,-0.2445,3.0);
CP1[playerid] = 1;
SendClientMessage(playerid,WHITE,"Route 3");
return 1;
}
if(BootsmannJames == 4)
{
SetPlayerCheckpoint(playerid,-2863.2322,1273.9257,-0.2789,3.0);
CP1[playerid] = 1;
SendClientMessage(playerid,WHITE,"Route 4");
return 1;
}*/
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid,WHITE,"Du bist nicht am Verladungsort nähe Flughafen! Checkpoint gestzt!");
SetPlayerCheckpoint(playerid,-1440.6125,390.9183,-0.0725,3.0);
return 1;
}
}
if(strcmp(tmp,"deliver",true) == 0)
{
if(PlayerInfo[playerid][pBootsmann] == 0)
{
SendClientMessage(playerid,WHITE,"Du hast keine Materialen dabei");
return 1;
}
else
{
if(CP1[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, -644.2157,861.9647,-0.1699))
{
new endlohn = PlayerInfo[playerid][pBootsmann]*500;
new string1111[128];
GivePlayerMoney(playerid,endlohn);
format(string1111, sizeof(string1111), "* Du hast %d Materials Pakete für $%d verkauft.", PlayerInfo[playerid][pBootsmann], endlohn);
PlayerInfo[playerid][pBootsmann] = 0;
CP1[playerid] = 0;
return 1;
}
else
{
SendClientMessage(playerid,WHITE,"Du bist nicht bei den jeweiloigen Cooridnaten!");
return 1;
}
}
else if(CP2[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, -854.0779,1380.6956,-0.1582))
{
new endlohn = PlayerInfo[playerid][pBootsmann]*500;
new string1111[128];
GivePlayerMoney(playerid,endlohn);
format(string1111, sizeof(string1111), "* Du hast %d Materials Pakete für $%d verkauft.", PlayerInfo[playerid][pBootsmann], endlohn);
PlayerInfo[playerid][pBootsmann] = 0;
return 1;
}
else
{
SendClientMessage(playerid,WHITE,"Du bist nicht bei den jeweiloigen Cooridnaten!");
return 1;
}
}
/* else if(CP3[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, -1445.6111,1506.9808,-0.2445))
{
new endlohn = PlayerInfo[playerid][pBootsmann]*500;
new string1111[128];
GivePlayerMoney(playerid,endlohn);
format(string1111, sizeof(string1111), "* Du hast %d Materials Pakete für $%d verkauft.", PlayerInfo[playerid][pBootsmann], endlohn);
PlayerInfo[playerid][pBootsmann] = 0;
return 1;
}
else
{
SendClientMessage(playerid,WHITE,"Du bist nicht bei den jeweiloigen Cooridnaten!");
return 1;
}
}
else if(CP4[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, -2863.2322,1273.9257,-0.2789))
{
new endlohn = PlayerInfo[playerid][pBootsmann]*500;
new string1111[128];
GivePlayerMoney(playerid,endlohn);
format(string1111, sizeof(string1111), "* Du hast %d Materials Pakete für $%d verkauft.", PlayerInfo[playerid][pBootsmann], endlohn);
PlayerInfo[playerid][pBootsmann] = 0;
return 1;
}
else
{
SendClientMessage(playerid,WHITE,"Du bist nicht bei den jeweiloigen Cooridnaten!");
return 1;
}
}
else
{
SendClientMessage(playerid,WHITE,"Du hast noch keine Route angenommen!");
}
return 1;*/
}
}
if(strcmp(tmp,"Anzahl",true) == 0)
{
new message[128];
format(message, sizeof(message), "* Du hast %d Materials", PlayerInfo[playerid][pBootsmann]);
SendClientMessage(playerid,WHITE,message);
return 1;
}
}
else
{
SendClientMessage(playerid,WHITE,"Du bist kein Bootsmann!");
return 1;
}
}
//BM2