SA-MP Forums Archive
command doesn't exist - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: command doesn't exist (/showthread.php?tid=381056)



command doesn't exist - JEkvall95 - 28.09.2012

I did add this to my gamemode
When I type /flip it says the command doesn't exist
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

  if(strcmp(cmdtext, "/flip", true) == 0)
  {
  if(IsPlayerInAnyVehicle(playerid))
  {
    new currentveh;
    new Float:angle;
    currentveh = GetPlayerVehicleID(playerid);
    GetVehicleZAngle(currentveh, angle);
    SetVehicleZAngle(currentveh, angle);
    SendClientMessage(playerid, 0xFFFFFFFF, "AdrenalineBot: Your vehicle has been flipped.");
    return 1;
  }
  else
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "AdrenalineBot: You are not in any vehicle!");
    return 1;
  }
  }
   return 0;
}



Re: command doesn't exist - JEkvall95 - 28.09.2012

Quote:
Originally Posted by [P]Awno
Посмотреть сообщение
Is ths Compile one ? (amx&pwn) ? If no , then this no work
I said I did put it in the gamemode


Re: command doesn't exist - BlueGames - 29.09.2012

So long why ?!
pawn Код:
if(strcmp(cmdtext,"/flip",true)==0)
    {
      if(PlayerInfo[playerid][power]>5)
         {
     new Float:X,Float:Y,Float:Z,Float:Angle;
     if (IsPlayerInAnyVehicle(playerid)){ GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,Angle); SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z + 1); SetVehicleZAngle(GetPlayerVehicleID(playerid),Angle); SendClientMessage(playerid,COLOR_YELLOW,"You have successfully flipped your vehicle.");
          }
      else SendClientMessage(playerid,COLOR_RED,"You must be in a vehicle.");
      }
     return 1;
     }
Works 100 %