if (strcmp("/apb", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 1493.9071,-1573.1179,67.2109);
SetPlayerFacingAngle(playerid, 184.5182);
SetCameraBehindPlayer(playerid);
GameTextForPlayer(playerid,"WELCOME TO ALL POINTS BULLETIN",5000,3);
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has teleported to All Points Bulletin (/apb)", pname);
SendClientMessageToAll(YELLOW, string);
SendClientMessage(playerid,YELLOW,"Type /apbr for APB rules!");
SendClientMessage(playerid,YELLOW,"Type /apbc for APB commands!");
SendClientMessage(playerid,YELLOW,"Type /kill to leave APB!");
ShowPlayerDialog(playerid, 15, DIALOG_STYLE_LIST,"{FF002B}ALL POINTS BULLETIN","Enforcer\nCriminal","Spawn","Cancel");
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
new isInDM[MAX_PLAYERS] // Put this under your defines/includes
OnPlayerSpawn:
isInDM[playerid] = 0;
<This needs to be in your teleport command>
isInDM[playerid] = 1;
Put this in the commands you want to prevent if he is in a DM
if(isInDM[playerid] = 1)
{
SendClientMessage(playerid, color_orange, "Please /kill yourself to teleport.");
return 1;
}
OnPlayerConnect:
isInDM[playerid] = 0;
if (!strcmp(cmdtext, "/fix"))
{
if(IsInDM[playerid] ==1)
{
SendClientMessage(playerid, red, "Please /kill yourself, then you can fix your car");
return 1;
}
//This is the code when your NOT in DM
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid, red, "Vehicle repaired");
return 1;
}
|
Yeah sure
pawn Код:
|