05.06.2010, 22:41
take the else out
how about that?
pawn Код:
if(strcmp(cmd,"/tanken",true)==0)
{
if(TankStation(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
tmp = strtok(cmdtext, idx);
new setin = strval(tmp);
if(GetPlayerMoney(playerid) < 2*setin){
SendClientMessage(playerid,FARBE_WEIЯ,"Du brauchst mindestens 2$ um zu tanken!"); //2 bucks a liter
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid,FARBE_WEIЯ,"Benutzung: Benutze /tanken [menge]");
return 1;
}
if(setin >= 101 || setin =< 0)
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du kanntst nicht ьber 100 Liter tanken!"); //more or less than 1-100
TogglePlayerControllable(playerid,1);
return 1;
}
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); //give x amount of petrol
SetTimerEx("TankZeit",2000,0, "dd", playerid, setin);
return 1;
}
}
else
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du sitz nicht in einem Fahrzeug!");//not in car?
return 1;
}
}
else
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du bist nicht an einer Tankstelle oder nicht nah genug dran!");//not at station
return 1;
}
}
return 1
}