Hallo Community,
wie mache ich das wenn man /durchsuchen an einer Mülltonne macht und das die dann 5 Minuten gesperrt ist?
Das habe ich bisher:
//Mülltonnen
CreateDynamicObject(1333,1323.6999500,-1581.5000000,13.4000000,0.0000000,0.0000000,170.0000000); //object(binnt03_la) (1)
CreateDynamicObject(1333,1272.9000200,-1472.1999500,9.9000000,0.0000000,0.0000000,0.0000000); //object(binnt03_la) (2)
CreateDynamicObject(1333,965.9000200,-1544.0999800,13.4000000,0.0000000,1.2500000,180.0000000); //object(binnt03_la) (3)
CreateDynamicObject(1333,1083.5000000,-1381.8000500,13.6000000,0.0000000,0.0000000,90.0000000); //object(binnt03_la) (4)
CreateDynamicObject(1333,1083.5996100,-1384.0996100,13.6000000,0.0000000,0.0000000,90.0000000); //object(binnt03_la) (5)
CreateDynamicObject(1333,1042.5996100,-1478.2998000,13.4000000,0.0000000,0.0000000,90.0000000); //object(binnt03_la) (6)
CreateDynamicObject(1333,848.5996100,-1370.5996100,13.6000000,0.0000000,1.2470000,90.0000000); //object(binnt03_la) (7)
CreateDynamicObject(1333,618.7999900,-1427.9000200,13.8000000,0.0000000,1.2470000,90.0000000); //object(binnt03_la) (8)
CreateDynamicObject(1333,618.7998000,-1425.5996100,13.7000000,0.0000000,1.2470000,90.0000000); //object(binnt03_la) (10)
CreateDynamicObject(1333,963.7000100,-1544.0999800,13.4000000,0.0000000,1.2470000,179.9950000); //object(binnt03_la) (11)
forward IstAnMull(playerid);
public IstAnMull(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,5.0,1323.6999500,-1581.5000000,13.4000000) || IsPlayerInRangeOfPoint(playerid,5.0,1272.9000200,-1472.1999500,9.9000000))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,5.0,965.9000200,-1544.0999800,13.4000000) || IsPlayerInRangeOfPoint(playerid,5.0,1083.5000000,-1381.8000500,13.6000000))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,5.0,1083.5996100,-1384.0996100,13.6000000) || IsPlayerInRangeOfPoint(playerid,5.0,1042.5996100,-1478.2998000,13.4000000))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,5.0,848.5996100,-1370.5996100,13.6000000) || IsPlayerInRangeOfPoint(playerid,5.0,618.7999900,-1427.9000200,13.8000000))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,5.0,618.7998000,-1425.5996100,13.7000000) || IsPlayerInRangeOfPoint(playerid,5.0,963.7000100,-1544.0999800,13.4000000))
{
return 1;
}
}
return 0;
}
dcmd_durchsuchen(playerid,params[])
{
#pragma unused params
if(IstAnMull(playerid))
{
if(durchsuchen[playerid] == 0)
{
new rand = random (9);
switch (rand)
{
case 0:
{
SendClientMessage(playerid,Gelb,"Du hast den Müll durchsucht und findest 20$!");
SetTimerEx("durchsuchen2", 1000*60*10, false, "d", playerid);
durchsuchen[playerid] = 1;
GivePlayerMoney(playerid,20);
}
case 1:
{
SendClientMessage(playerid,Gelb,"Du hast einen Schuh gefunden!");
SetTimerEx("durchsuchen2", 1000*60*10, false, "d", playerid);
durchsuchen[playerid] = 1;
}
case 2:
{
SendClientMessage(playerid,Gelb,"Du hast einen Fisch gefunden!");
SetTimerEx("durchsuchen2", 1000*60*10, false, "d", playerid);
durchsuchen[playerid] = 1;
SInfo[playerid][pFisch] += 1;
}
case 3:
{
SendClientMessage(playerid,Gelb,"Du hast eine Hose gefunden!");
SetTimerEx("durchsuchen2", 1000*60*10, false, "d", playerid);
durchsuchen[playerid] = 1;
}
case 4:
{
SendClientMessage(playerid,Gelb,"Du hast den Müll durchsucht und findest 40$!");
SetTimerEx("durchsuchen", 1000*60*10, false, "d", playerid);
durchsuchen[playerid] = 1;
GivePlayerMoney(playerid,40);
}
case 5:
{
SendClientMessage(playerid,Gelb,"Du hast eine Pfandflasche gefunden!");
SInfo[playerid][pPfand] += 1;
SetTimerEx("durchsuchen2", 1000*60*10, false, "d", playerid);
durchsuchen[playerid] = 1;
}
case 6:
{
SendClientMessage(playerid,Gelb,"Du hast den Müll durchsucht und findest 32$!");
SetTimerEx("durchsuchen2", 1000*60*10, false, "d", playerid);
durchsuchen[playerid] = 1;
GivePlayerMoney(playerid,32);
}
case 7:
{
SendClientMessage(playerid,Gelb,"Du hast nichts gefunden...");
SetTimerEx("durchsuchen2", 1000*60*10, false, "d", playerid);
durchsuchen[playerid] = 1;
}
case 8:
{
SendClientMessage(playerid,Gelb,"Du hast nichts gefunden...");
SetTimerEx("durchsuchen2", 1000*60*10, false, "d", playerid);
durchsuchen[playerid] = 1;
}
}
}
else
{
SendClientMessage(playerid,0x828282FF,"Du kannst die Mülleimer noch nicht durchsuchen...");
}
}
else
{
SendClientMessage(playerid,0x828282FF,"Du hast nichts gefunden...");
}
return 1;
}
Hoffe ihr könnt mir helfen
LG