public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 3354.339844, -2152.024902, 705.970459);
SetPlayerInterior(playerid, 0);
FreezePlayer(playerid, 2000);
return 1;
}
if (strcmp("/objective", cmdtext, true, 10) == 0)
{
if(TEAM_COP[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, " You are a Cop ");
SendClientMessage(playerid, COLOR_YELLOW, " Your objective is to guard the prisoners ");
SendClientMessage(playerid, COLOR_YELLOW, " And stop the from escaping at all means! ");
SendClientMessage(playerid, COLOR_YELLOW, " You can gain weapons + Ammo at the store room");
SendClientMessage(playerid, COLOR_YELLOW, " For help type /help");
return 1;
}
if (strcmp("/opensec", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(2.0,playerid,2651.119873, -2745.723877, 4.287249))
if(TEAM_COP[playerid] == 1)
{
SetObjectRot(Sec, 0.0000, 0.0000, 18.9076);
}
return 1;
}
if (strcmp("/closesec", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(2.0,playerid,2651.119873, -2745.723877, 4.287249))
if(TEAM_COP[playerid] == 1)
{
SetObjectRot(Sec, 0.0000, 0.0000, 89.3814);
}
return 1;
}
if (strcmp("/lockdown", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(1.0,playerid,2653.1077,-2742.4539,5.2934))
if(TEAM_COP[playerid] == 1)
{
MoveObject(LD, 2651.496582, -2745.657959, 6.613323, 2);
GameTextForAll("~P~Prison ~R~LOCKDOWN!",500,1);
SetTimer("Alarm1", 3500, 1);
Locked[playerid] = 1;
}
return 1;
}
if (strcmp("/lockdownO", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(1.0,playerid,2653.1077,-2742.4539,5.2934))
if(TEAM_COP[playerid] == 1)
{
MoveObject(LD, 2640.496582, -2745.657959, 0.713324, 2);
GameTextForAll("~P~Prison ~R~LOCKDOWN ~P~OVER",500,1);
Locked[playerid] = 0;
}
return 1;
}
}
return 0;
}
Originally Posted by silvan
change the last " return 0 " to return 1 "
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true) == 0)
{
SetPlayerPos(playerid, 3354.339844, -2152.024902, 705.970459);
SetPlayerInterior(playerid, 0);
FreezePlayer(playerid, 2000);
return 1;
}
if (strcmp("/objective", cmdtext, true) == 0)
{
if(TEAM_COP[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, " You are a Cop ");
SendClientMessage(playerid, COLOR_YELLOW, " Your objective is to guard the prisoners ");
SendClientMessage(playerid, COLOR_YELLOW, " And stop the from escaping at all means! ");
SendClientMessage(playerid, COLOR_YELLOW, " You can gain weapons + Ammo at the store room");
SendClientMessage(playerid, COLOR_YELLOW, " For help type /help");
return 1;
}
if (strcmp("/opensec", cmdtext, true) == 0)
{
if(PlayerToPoint(2.0,playerid,2651.119873, -2745.723877, 4.287249))
if(TEAM_COP[playerid] == 1)
{
SetObjectRot(Sec, 0.0000, 0.0000, 18.9076);
}
return 1;
}
if (strcmp("/closesec", cmdtext, true) == 0)
{
if(PlayerToPoint(2.0,playerid,2651.119873, -2745.723877, 4.287249))
if(TEAM_COP[playerid] == 1)
{
SetObjectRot(Sec, 0.0000, 0.0000, 89.3814);
}
return 1;
}
if (strcmp("/lockdown", cmdtext, true) == 0)
{
if(PlayerToPoint(1.0,playerid,2653.1077,-2742.4539,5.2934))
if(TEAM_COP[playerid] == 1)
{
MoveObject(LD, 2651.496582, -2745.657959, 6.613323, 2);
GameTextForAll("~P~Prison ~R~LOCKDOWN!",500,1);
SetTimer("Alarm1", 3500, 1);
Locked[playerid] = 1;
}
return 1;
}
if (strcmp("/lockdownO", cmdtext, true) == 0)
{
if(PlayerToPoint(1.0,playerid,2653.1077,-2742.4539,5.2934))
if(TEAM_COP[playerid] == 1)
{
MoveObject(LD, 2640.496582, -2745.657959, 0.713324, 2);
GameTextForAll("~P~Prison ~R~LOCKDOWN ~P~OVER",500,1);
Locked[playerid] = 0;
}
return 1;
}
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true) == 0)
{
SetPlayerPos(playerid, 3354.339844, -2152.024902, 705.970459);
SetPlayerInterior(playerid, 0);
FreezePlayer(playerid, 2000);
return 1;
}
if (strcmp("/objective", cmdtext, true) == 0)
{
if(TEAM_COP[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, " You are a Cop ");
SendClientMessage(playerid, COLOR_YELLOW, " Your objective is to guard the prisoners ");
SendClientMessage(playerid, COLOR_YELLOW, " And stop the from escaping at all means! ");
SendClientMessage(playerid, COLOR_YELLOW, " You can gain weapons + Ammo at the store room");
SendClientMessage(playerid, COLOR_YELLOW, " For help type /help");
}
return 1;
}
if (strcmp("/opensec", cmdtext, true) == 0)
{
if(PlayerToPoint(2.0,playerid,2651.119873, -2745.723877, 4.287249))
{
if(TEAM_COP[playerid] == 1)
{
SetObjectRot(Sec, 0.0000, 0.0000, 18.9076);
}
}
return 1;
}
if (strcmp("/closesec", cmdtext, true) == 0)
{
if(PlayerToPoint(2.0,playerid,2651.119873, -2745.723877, 4.287249))
{
if(TEAM_COP[playerid] == 1)
{
SetObjectRot(Sec, 0.0000, 0.0000, 89.3814);
}
}
return 1;
}
if (strcmp("/lockdown", cmdtext, true) == 0)
{
if(PlayerToPoint(1.0,playerid,2653.1077,-2742.4539,5.2934))
{
if(TEAM_COP[playerid] == 1)
{
MoveObject(LD, 2651.496582, -2745.657959, 6.613323, 2);
GameTextForAll("~P~Prison ~R~LOCKDOWN!",500,1);
SetTimer("Alarm1", 3500, 1);
Locked[playerid] = 1;
}
}
return 1;
}
if (strcmp("/lockdownO", cmdtext, true) == 0)
{
if(PlayerToPoint(1.0,playerid,2653.1077,-2742.4539,5.2934))
{
if(TEAM_COP[playerid] == 1)
{
MoveObject(LD, 2640.496582, -2745.657959, 0.713324, 2);
GameTextForAll("~P~Prison ~R~LOCKDOWN ~P~OVER",500,1);
Locked[playerid] = 0;
}
}
return 1;
}
return 0;
}