Spam Command
#1

How to stop the command stop spam?
Код:
SendClientMessage(playerid, 0xFF0000AA, "You not at the Gas Station!");
PHP код:
CMD:refull(playeridparams[])
{
     if (
GetPlayerVehicleSeat(playerid) == 0)
     for (new 
isizeof(ARefuelPickups); i++)
     if(
IsPlayerInRangeOfPoint(playerid2.5ARefuelPickups[i][pux], ARefuelPickups[i][puy], ARefuelPickups[i][puz]))
     {
     
SetTimerEx("RefuelVehicle"5000false"i"playerid);
     
TogglePlayerControllable(playerid0);
     
GameTextForPlayer(playeridTXT_Refuelling30004);
     }
     else
     
SendClientMessage(playerid0xFF0000AA"You not at the Gas Station!");
     return 
1;

Reply
#2

Try this:
pawn Код:
CMD:refull(playerid, params[])
{
     if (GetPlayerVehicleSeat(playerid) == 0)
     if(IsPlayerInRangeOfPoint(playerid, 2.5, ARefuelPickups[i][pux], ARefuelPickups[i][puy], ARefuelPickups[i][puz]))
     {
         for (new i; i < sizeof(ARefuelPickups); i++)
         {
         SetTimerEx("RefuelVehicle", 5000, false, "i", playerid);
         }
         TogglePlayerControllable(playerid, 0);
         GameTextForPlayer(playerid, TXT_Refuelling, 3000, 4);
     }
     else SendClientMessage(playerid, 0xFF0000AA, "You not at the Gas Station!");
     return 1;
}
Reply
#3

pawn Код:
CMD:refull(playerid, params[])
{
     if (GetPlayerVehicleSeat(playerid) == 0)
     for (new i; i < sizeof(ARefuelPickups); i++)
     if(IsPlayerInRangeOfPoint(playerid, 2.5, ARefuelPickups[i][pux], ARefuelPickups[i][puy], ARefuelPickups[i][puz]))
     {
     SetTimerEx("RefuelVehicle", 5000, false, "i", playerid);
     TogglePlayerControllable(playerid, 0);
     GameTextForPlayer(playerid, TXT_Refuelling, 3000, 4);
     break;
     }
     else
     SendClientMessage(playerid, 0xFF0000AA, "You not at the Gas Station!");
   
     return 1;
}
Reply
#4

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
Try this:
pawn Код:
CMD:refull(playerid, params[])
{
     if (GetPlayerVehicleSeat(playerid) == 0)
     if(IsPlayerInRangeOfPoint(playerid, 2.5, ARefuelPickups[i][pux], ARefuelPickups[i][puy], ARefuelPickups[i][puz]))
     {
         for (new i; i < sizeof(ARefuelPickups); i++)
         {
         SetTimerEx("RefuelVehicle", 5000, false, "i", playerid);
         }
         TogglePlayerControllable(playerid, 0);
         GameTextForPlayer(playerid, TXT_Refuelling, 3000, 4);
     }
     else SendClientMessage(playerid, 0xFF0000AA, "You not at the Gas Station!");
     return 1;
}
Код:
error 017: undefined symbol "i"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

EDIT: no sorry, wrong, I give up. I can't understand how the situation is. with those pickups...
Reply
#6

Quote:
Originally Posted by JustBored
Посмотреть сообщение
pawn Код:
CMD:refull(playerid, params[])
{
     if (GetPlayerVehicleSeat(playerid) == 0)
     for (new i; i < sizeof(ARefuelPickups); i++)
     if(IsPlayerInRangeOfPoint(playerid, 2.5, ARefuelPickups[i][pux], ARefuelPickups[i][puy], ARefuelPickups[i][puz]))
     {
     SetTimerEx("RefuelVehicle", 5000, false, "i", playerid);
     TogglePlayerControllable(playerid, 0);
     GameTextForPlayer(playerid, TXT_Refuelling, 3000, 4);
     break;
     }
     else
     SendClientMessage(playerid, 0xFF0000AA, "You not at the Gas Station!");
   
     return 1;
}
it gave me errors.
Reply
#7

pawn Код:
bool:IsPlayerAtGasStation(playerid)
{

    for(new i; i != sizeof(ARefuelPickups); i++)
        if(IsPlayerInRangeOfPoint(playerid, 2.5, ARefuelPickups[i][pux], ARefuelPickups[i][puy], ARefuelPickups[i][puz]))
            return true;

    return false;
}

CMD:refull(playerid, params[])
{
    if(GetPlayerVehicleSeat(playerid) != 0) SendClientMessage(playerid, 0xFF0000AA, "You are not a driver");
    else if(!IsPlayerAtGasStation(playerid)) SendClientMessage(playerid, 0xFF0000AA, "You not at the Gas Station!");
    else{
        SetTimerEx("RefuelVehicle", 5000, false, "i", playerid);
        TogglePlayerControllable(playerid, 0);
        GameTextForPlayer(playerid, TXT_Refuelling, 3000, 4);
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
bool:IsPlayerAtGasStation(playerid)
{

    for(new i; i != sizeof(ARefuelPickups); i++)
        if(IsPlayerInRangeOfPoint(playerid, 2.5, ARefuelPickups[i][pux], ARefuelPickups[i][puy], ARefuelPickups[i][puz]))
            return true;

    return false;
}

CMD:refull(playerid, params[])
{
    if(GetPlayerVehicleSeat(playerid) != 0) SendClientMessage(playerid, 0xFF0000AA, "You are not a driver");
    else if(!IsPlayerAtGasStation(playerid)) SendClientMessage(playerid, 0xFF0000AA, "You not at the Gas Station!");
    else{
        SetTimerEx("RefuelVehicle", 5000, false, "i", playerid);
        TogglePlayerControllable(playerid, 0);
        GameTextForPlayer(playerid, TXT_Refuelling, 3000, 4);
    }
    return 1;
}
Код:
warning 208: function with tag result used before definition, forcing reparse
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#9

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
Код:
warning 208: function with tag result used before definition, forcing reparse
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Which line it errors?
Reply
#10

pawn Код:
bool:IsPlayerAtGasStation(playerid)
{

    for(new i; i != sizeof(ARefuelPickups); i++)
        if(IsPlayerInRangeOfPoint(playerid, 2.5, ARefuelPickups[i][pux], ARefuelPickups[i][puy], ARefuelPickups[i][puz]))
            return true;

    return false;
}
must be on top of gamemode and all cmds where you are using IsPlayerAtGasStation(playerid)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)