• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Command not working
#1
Okay so I have this weird problem with this one specific command. When player performs this command, he gets teleported somewhere else instead of where he's supposed to. But I'm calling the same command under OnDialogResponse and it works fine there. Here's the command:
Code:
CMD:mc(playerid, params[])
{
? ? LoginCheck(playerid);
? ? SpawnCheck(playerid);
? ? IntCheck(playerid);

? ? if(!Permissions(playerid))
? ? return 1;

? ? SetCameraBehindPlayer(playerid);
? ? new RandomT = random(sizeof(mount));
? ? new Randomm = random(sizeof(mountv));

? ? if(IsPlayerInAnyVehicle(playerid))
? ? {
? ? ? ? SetVehiclePos(GetPlayerVehicleID(playerid), mountv[Randomm][0], mountv[Randomm][1], mountv[Randomm][2]);
? ? }
? ? else
? ? {
? ? ? ? SetPlayerPos(playerid, mount[RandomT][0], mount[RandomT][1], mount[RandomT][2]);
? ? }
? ? new string[128], name[24];
? ? GetPlayerName(playerid, name, 24);
? ? format(string, 128, "%s(%d) has teleported to Mount Chilliad (/mc).", name, playerid);
? ? SendClientMessageToAll(COLOR_TP, string);
? ? return 1;
}

Calling it under dialog response like this
Code:
if(listitem ==7)
? ? ? ? ? ? {
? ? ? ? ? ? cmd_mc(playerid, "");
? ? ? ? ? ? }

Now when player types the command manually, he won't get teleported to Mount Chilliad but when he uses the dialog that calls this command, he'll be teleported here.
[Image: QIDa2vB.png]

  Reply


Messages In This Thread
Command not working - by Snow - 2021-03-29, 06:25 PM
RE: Command not working - by Radical - 2021-03-29, 09:43 PM
RE: Command not working - by Snow - 2021-03-29, 09:55 PM
RE: Command not working - by Radical - 2021-03-30, 04:27 AM
RE: Command not working - by Snow - 2021-03-30, 05:59 AM
RE: Command not working - by ImOver - 2021-04-03, 07:55 PM
RE: Command not working - by Snow - 2021-04-04, 04:59 PM

Forum Jump: