if(strcmp(cmd, "/refill", true) == 0) { if(IsPlayerConnected(playerid) == 1) { if(IsPlayerInAnyVehicle(playerid) == 1) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(IsAtGasStation(playerid) == 1) { if(GetVehType(GetPlayerVehicleID(playerid)) == 4) { SendPlayerRandomizeText(playerid,GREENIE,GAS_SERVICE_TEXT); TogglePlayerControllable(playerid,0); ChoosingGas[playerid] = 1; } else { SendMessage(playerid,WHITE,"[*] You can't fill this vehicle."); } } else { SendMessage(playerid,WHITE,"[*] You're not at Gas station."); } } else { SendMessage(playerid,WHITE,"[*] You're not a driver."); } } else { SendMessage(playerid,WHITE,"[*] You're not in a vehicle."); } } return 1; } return 0; }
if(strcmp(cmd, "/refilladm", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
Fuel[GetPlayerVehicleID(playerid)] = 999; // Change the array name & value to the correct ones
return SendMessage(playerid,WHITE,"[*] Vehicle refilled.");
}
else return SendMessage(playerid,WHITE,"[*] You're not driving a vehicle.");
}
else return SendMessage(playerid,WHITE,"[*] You're not an admin.");
}
Originally Posted by breakpaper
it's a filterscript
and if i do it there is standing errors! EDIT:it don't work! there is standing: you are not an admin! |
stock PlayerName(playerid) {
GetPlayerName(playerid, name, 255);
return name;
}
if(strcmp(cmd, "/refilladm", true) == 0)
{
if(dini_Get(PlayerName(playerid), "adminlevel") >= 1)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
Fuel[GetPlayerVehicleID(playerid)] = 999; // Change the array name & value to the correct ones
return SendMessage(playerid,WHITE,"[*] Vehicle refilled.");
}
else return SendMessage(playerid,WHITE,"[*] You're not driving a vehicle.");
}
else return SendMessage(playerid,WHITE,"[*] You're not an admin.");
}