public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("UK-RP v0.1");
AddPlayerClass(299,1614.7527,-1498.3807,14.2381,90.9994,0,0,0,0,0,0); // newb spawn
// Special houses
CreateObject(3483, -2329.9060058594, -1619.1413574219, 489.66583251953, 1, 0, 0); // admin house
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(pay, 3, cmdtext);
dcmd(sethealth, 9, cmdtext);
// admin cmds---------------------------
dcmd(sendtopd, 8, cmdtext);
dcmd(sendtogym, 9, cmdtext);
dcmd(sendtoadmh, 10, cmdtext); // the dcmd define for my tp cmd
// text--------------------------------
dcmd(me, 2, cmdtext);
dcmd(do, 2, cmdtext);
// player connect----------------------
dcmd(register, 8, cmdtext);
dcmd(login, 5, cmdtext);
return 1;
}
dcmd_sendtoadmh(playerid, params[])
{
new targetid, pName[MAX_PLAYER_NAME];
if(sscanf(params, "i", targetid)) return SendClientMessage, COLOR_RED, "/sendtoadmh [playerid]");
else if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You have no access to this command");
else if(targetid == INVALID_PLAYER_ID || IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "Player Not Found");
else
{
GetPlayerName(targetid, pName, MAX_PLAYER_NAME);
SetPlayerPos(targetid, -2329.9060058594, -1619.1413574219, 489.66583251953);
format(string, 128, "You transfered %s (ID: %i) to Admin's House", pName, targetid);
format(msg, 128, "You got transfered to Admin's House by Admin %s", playerid);
SendClientMessage(playerid, COLOR_LIGHTBULE, string);
SendClientMessage(targetid, COLOR_LIGHTBLUE, msg);
}
return 1;
}
dcmd_sendtoadmh(playerid, params[])
{
new targetid, pName[MAX_PLAYER_NAME],Playername[MAX_PLAYER_NAME];
if(sscanf(params, "i", targetid)) return SendClientMessage, COLOR_RED, "/sendtoadmh [playerid]");
{
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You have no access to this command");
{
if(targetid == INVALID_PLAYER_ID || IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "Player Not Found");
{
GetPlayerName(targetid, pName, MAX_PLAYER_NAME);
GetPlayerName(playerid, Playername, MAX_PLAYER_NAME);
SetPlayerPos(targetid, -2329.9060058594, -1619.1413574219, 489.66583251953);
format(string, 128, "You transfered %s (ID: %i) to Admin's House", pName, targetid);
format(msg, 128, "You got transfered to Admin's House by Admin %s", Playername, playerid);
SendClientMessage(playerid, COLOR_LIGHTBULE, string);
SendClientMessage(targetid, COLOR_LIGHTBLUE, msg);
return 1;
}
}
}
}
Probably your define for the color is wrong.
Btw, you are checking if the player is connected -> return invalid Player ID :P |
dcmd_sendtoadmh(playerid, params[])
{
new targetid, pName[MAX_PLAYER_NAME];
if(sscanf(params, "i", targetid)) return SendClientMessage, COLOR_RED, "/sendtoadmh [playerid]");
else if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You have no access to this command");
else if(targetid == INVALID_PLAYER_ID || IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "Player Not Found");
GetPlayerName(targetid, pName, MAX_PLAYER_NAME);
SetPlayerPos(targetid, -2329.9060058594, -1619.1413574219, 489.66583251953);
format(string, 128, "You transfered %s (ID: %i) to Admin's House", pName, targetid);
format(msg, 128, "You got transfered to Admin's House by Admin %s", playerid);
SendClientMessage(playerid, COLOR_LIGHTBULE, string);
SendClientMessage(targetid, COLOR_LIGHTBLUE, msg);
return 1;
}
dcmd_sendtoadmh(playerid, params[])
{
new targetid, pName[MAX_PLAYER_NAME];
if(sscanf(params, "u", targetid)) return SendClientMessage, COLOR_RED, "/sendtoadmh [playerid]");
else if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You have no access to this command");
else if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player Not Found");
GetPlayerName(targetid, pName, MAX_PLAYER_NAME);
SetPlayerPos(targetid, -2329.9060058594, -1619.1413574219, 489.66583251953);
format(string, 128, "You transfered %s (ID: %d) to Admin's House", pName, targetid);
format(msg, 128, "You got transfered to Admin's House by Admin ID %d", playerid);
SendClientMessage(playerid, COLOR_LIGHTBULE, string);
SendClientMessage(targetid, COLOR_LIGHTBLUE, msg);
return 1;
}