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:
Calling it under dialog response like this
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.
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.