//ALL THE BASIC CMDS (IMPORTANT ONES)
CMD:me(playerid, params[])
{
new
string[128],
action[100];
if(sscanf(params, "s[100]", action))
{
SendClientMessage(playerid, -1, "USAGE: /me [action]");
return 1;
}
else
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string, sizeof(string), "* %s %s",pName, action);
}
return 1;
}
CMD:do(playerid, params[])
{
new
string[128],
action[100];
if(sscanf(params, "s[100]", action))
{
SendClientMessage(playerid, -1, "USAGE: /do [action]");
return 1;
}
else
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string, sizeof(string), "* %s ((%s))",action, pName);
}
return 1;
}
// This shouldn't be inside ANY function. I personally insert mine BELOW OnGameModeInit - Not within it.
CMD:adminroof(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1847.7333,-1761.9608,13.5469))
{
SetPlayerPos(playerid, 1889.0286,-1782.9777,25.7911);//Naar boven
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN, "*You use the elevator to get on the roof*");
return 1;
}
SendClientMessage(playerid,0xFFFFFF00,"DEBUG: Not in range!");
return 1;
}
CMD:admindown(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1889.0286,-1782.9777,25.7911))
{
SetPlayerPos(playerid, 1847.7333,-1761.9608,13.5469);//Naar beneden
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN, "*You use the elevator to get down from the roof*");
return 1;
}
SendClientMessage(playerid,0xFFFFFF00,"DEBUG: Not in range!");
return 1;
}
//ALL THE BASIC CMDS (IMPORTANT ONES)
CMD:me(playerid, params[])
{
new
string[128],
action[100];
if(sscanf(params, "s[100]", action))
{
SendClientMessage(playerid, -1, "USAGE: /me [action]");
return 1;
}
else
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string, sizeof(string), "* %s %s",pName, action);
SendClientMessage(playerid,COLOR_HERE,string); // <<----------
}
return 1;
}
CMD:do(playerid, params[])
{
new
string[128],
action[100];
if(sscanf(params, "s[100]", action))
{
SendClientMessage(playerid, -1, "USAGE: /do [action]");
return 1;
}
else
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string, sizeof(string), "* %s ((%s))",action, pName);
SendClientMessage(playerid,COLOR_HERE,string); // <<----------
}
return 1;
}
// This shouldn't be inside ANY function. I personally insert mine BELOW OnGameModeInit - Not within it.
CMD:adminroof(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1847.7333,-1761.9608,13.5469))
{
SetPlayerPos(playerid, 1889.0286,-1782.9777,25.7911);//Naar boven
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN, "*You use the elevator to get on the roof*");
return 1;
}
SendClientMessage(playerid,0xFFFFFF00,"DEBUG: Not in range!");
return 1;
}
CMD:admindown(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1889.0286,-1782.9777,25.7911))
{
SetPlayerPos(playerid, 1847.7333,-1761.9608,13.5469);//Naar beneden
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN, "*You use the elevator to get down from the roof*");
return 1;
}
SendClientMessage(playerid,0xFFFFFF00,"DEBUG: Not in range!");
return 1;
}
CMD:me(playerid, params[])
{
new string[128];
if(isnull(params)) SendClientMessage(playerid, -1, "USAGE: /me [action]");
else
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string, sizeof(string), "* %s %s",pName, action);
SendClientMessage(playerid,COLOR_HERE,string); // <<----------
}
return 1;
}
CMD:adminroof(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1847.7333,-1761.9608,13.5469))
{
SetPlayerPos(playerid, 1889.0286,-1782.9777,25.7911);//Naar boven
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN, "*You use the elevator to get on the roof*");
return 1; // This is to prevent the code from further executing.
}
SendClientMessage(playerid,0xFFFFFF00,"DEBUG: Not in range!"); //If the IsPlayerInRangeOfPoint check fails,
// ..the script will fall through to this message and finally return. We don't want to see this when they're in range.
return 1;
}
SomeCheck()
{
if(a == 1)
{
DoSomeThing();
return 1;
}
DoSomeThingElse();
return 1;
}
SomeCheck()
{
if(a == 1)
{
DoSomething();
}
else
{
DoSomethingElse();
}
return 1;
}
|
Read the comments.
return 1; // This is to prevent the code from further executing. |
CMD:adminroof(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1847.7333,-1761.9608,13.5469))
{
SetPlayerPos(playerid, 1889.0286,-1782.9777,25.7911);//Naar boven
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN, "*You use the elevator to get on the roof*");
}
else SendClientMessage(playerid,0xFFFFFF00,"DEBUG: Not in range!"); //If the IsPlayerInRangeOfPoint check fails,
return 1;
}