05.06.2010, 21:42
(Sry for bad English! )
I created a CMD
if(strcmp(cmd,"/tanken",true)==0)
{
if(TankStation(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerMoney(playerid) > 2)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,FARBE_WEIЯ,"Benutzung: Benutze /tanken [menge]");
return 1;
}
new setin = strval(tmp);
new summe = strval(tmp);
new tString[64];
TogglePlayerControllable(playerid,0);
GivePlayerMoney(playerid,-setin*2);
format(tString,sizeof(tString),"Du Tankst %d Liter und bezahlst dafьr $%d.",setin,summe*2);
SendClientMessage(playerid,FARBE_GRЬN,tString);
SetTimerEx("TankZeit",2000,0, "dd", playerid, setin);
return 1;
}
else if(LimitTest >= 101)
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du kanntst nicht ьber 100 Liter tanken!");
TogglePlayerControllable(playerid,1);
return 1;
}
else
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du brauchst mindestens 2$ um zu tanken!");
}
}
else
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du sitz nicht in einem Fahrzeug!");
}
}
else
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du bist nicht an einer Tankstelle oder nicht nah genug dran!");
}
}
return 1;
}
This is my / fill CMD,
I have it set up so that if I for example 95 liters of gasoline and
/tanken 6 write, then my car will be refueled, but I'm there
else if(LimitTest >= 101)
{
SendClientMessage(playerid,FARBE_WEIЯ,"You knew not fill up more than 100 liters!");
TogglePlayerControllable(playerid,1);
return 1;
}
installed, it should get the text that I can not fill up more than 100 liters of petrol, but will fill up my car and my money will be deducted.
I hope someone can help me: (
I created a CMD
if(strcmp(cmd,"/tanken",true)==0)
{
if(TankStation(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerMoney(playerid) > 2)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,FARBE_WEIЯ,"Benutzung: Benutze /tanken [menge]");
return 1;
}
new setin = strval(tmp);
new summe = strval(tmp);
new tString[64];
TogglePlayerControllable(playerid,0);
GivePlayerMoney(playerid,-setin*2);
format(tString,sizeof(tString),"Du Tankst %d Liter und bezahlst dafьr $%d.",setin,summe*2);
SendClientMessage(playerid,FARBE_GRЬN,tString);
SetTimerEx("TankZeit",2000,0, "dd", playerid, setin);
return 1;
}
else if(LimitTest >= 101)
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du kanntst nicht ьber 100 Liter tanken!");
TogglePlayerControllable(playerid,1);
return 1;
}
else
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du brauchst mindestens 2$ um zu tanken!");
}
}
else
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du sitz nicht in einem Fahrzeug!");
}
}
else
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du bist nicht an einer Tankstelle oder nicht nah genug dran!");
}
}
return 1;
}
This is my / fill CMD,
I have it set up so that if I for example 95 liters of gasoline and
/tanken 6 write, then my car will be refueled, but I'm there
else if(LimitTest >= 101)
{
SendClientMessage(playerid,FARBE_WEIЯ,"You knew not fill up more than 100 liters!");
TogglePlayerControllable(playerid,1);
return 1;
}
installed, it should get the text that I can not fill up more than 100 liters of petrol, but will fill up my car and my money will be deducted.
I hope someone can help me: (