help with some error
#1

Can any one see why all my commands keep spawning me at /aa thx for any help


pawn Код:
if(strcmp(cmdtext,"/afk", true, 4) == 0)
   {
   new name[MAX_PLAYER_NAME];
   GetPlayerName(playerid, name, 24);
   SendClientMessage(playerid, 0xFF0000AA, "You have gone AFK..");
   SetPlayerVirtualWorld(playerid, 1337);
   TogglePlayerControllable(playerid, 0);
   return 1;
   }
 if(strcmp(cmdtext, "/back", true, 5) == 0)
   {
   new name[MAX_PLAYER_NAME];
   GetPlayerName(playerid, name, 24);
   SendClientMessage(playerid, 0xFF0000AA, "You've Back from AFK..");
   SetPlayerVirtualWorld(playerid, 0);
   TogglePlayerControllable(playerid, 1);
   return 1;
   }
 if(strcmp(cmdtext, "/aa", true) == 0)
   {
   SetVehiclePos(GetPlayerVehicleID(playerid), 1404.1338,2436.8818,16.5000);
   SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
   LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
   }
   else
   {
   SetPlayerInterior(playerid, 0);
   SetPlayerPos(playerid, 1404.1338,2436.8818,16.5000);
   GameTextForPlayer(playerid,"Abandon Airport",4000,6);
   return 1;
   }
 if(strcmp(cmdtext, "/islanddm", true) == 0)
   {
   SetPlayerInterior(playerid, 0);
   RemovePlayerFromVehicle(playerid);
   ResetPlayerWeapons(playerid);
   SetPlayerPos(playerid, 1372.8043,-3284.4734,3.1422);
   GivePlayerWeapon(playerid, 22, 5200);
   GivePlayerWeapon(playerid, 27, 1100);
   GivePlayerWeapon(playerid, 31, 4000);
   GameTextForPlayer(playerid,"Island Dm",4000,6);
   return 1;
   }
 if(strcmp(cmdtext, "/lvairstunt", true) == 0)
   {
   SetVehiclePos(GetPlayerVehicleID(playerid), 1066.05,1319.98,247.50);
   SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
   LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
   }
   else
   {
   SetPlayerInterior(playerid, 0);
   SetPlayerPos(playerid,1066.05,1319.98,247.50);
   GameTextForPlayer(playerid,"Use /Carmenu for vehicles!!",4000,6);
   return 1;
   }
Reply
#2

Here you go. I have no idea why you had }else{ in there but yea here.

pawn Код:
if(strcmp(cmdtext,"/afk", true, 4) == 0)
 {
   new name[MAX_PLAYER_NAME];
   GetPlayerName(playerid, name, 24);
   SendClientMessage(playerid, 0xFF0000AA, "You have gone AFK..");
   SetPlayerVirtualWorld(playerid, 1337);
   TogglePlayerControllable(playerid, 0);
   return 1;
 }
 if(strcmp(cmdtext, "/back", true, 5) == 0)
 {
   new name[MAX_PLAYER_NAME];
   GetPlayerName(playerid, name, 24);
   SendClientMessage(playerid, 0xFF0000AA, "You've Back from AFK..");
   SetPlayerVirtualWorld(playerid, 0);
   TogglePlayerControllable(playerid, 1);
   return 1;
 }
 if(strcmp(cmdtext, "/aa", true) == 0)
 {
   SetVehiclePos(GetPlayerVehicleID(playerid), 1404.1338,2436.8818,16.5000);
   SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
   LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
   SetPlayerInterior(playerid, 0);
   SetPlayerPos(playerid, 1404.1338,2436.8818,16.5000);
   GameTextForPlayer(playerid,"Abandon Airport",4000,6);
   return 1;
 }
 if(strcmp(cmdtext, "/islanddm", true) == 0)
 {
   SetPlayerInterior(playerid, 0);
   RemovePlayerFromVehicle(playerid);
   ResetPlayerWeapons(playerid);
   SetPlayerPos(playerid, 1372.8043,-3284.4734,3.1422);
   GivePlayerWeapon(playerid, 22, 5200);
   GivePlayerWeapon(playerid, 27, 1100);
   GivePlayerWeapon(playerid, 31, 4000);
   GameTextForPlayer(playerid,"Island Dm",4000,6);
   return 1;
 }
 if(strcmp(cmdtext, "/lvairstunt", true) == 0)
 {
   SetVehiclePos(GetPlayerVehicleID(playerid), 1066.05,1319.98,247.50);
   SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
   LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
   SetPlayerInterior(playerid, 0);
   SetPlayerPos(playerid,1066.05,1319.98,247.50);
   GameTextForPlayer(playerid,"Use /Carmenu for vehicles!!",4000,6);
   return 1;
 }
Reply
#3

Not a clue what ViruZz has done but I think the trick is that you specify a command length at one command and none at the other. I'd recommend not putting a length altogether which will save you some time. Even more time can be saved if you switch to a better command processor at this early stage!
Reply
#4

thx for the help ViruZz +rep added
Reply
#5

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
Not a clue what ViruZz has done but I think the trick is that you specify a command length at one command and none at the other. I'd recommend not putting a length altogether which will save you some time. Even more time can be saved if you switch to a better command processor at this early stage!
what is the best command processor mamorunl
Reply
#6

Quote:
Originally Posted by scottygraham1990
Посмотреть сообщение
what is the best command processor mamorunl
The one that suits your needs the best. I am using ZCMD but you might as well find YCMD better. That is all up to personal taste.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)