07.03.2010, 10:47
Quote:
Originally Posted by Zak_Wicks
ALMOST good cause why dont my cmds work? heres part of my scriptfile:
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { //Admin Gate if (strcmp(cmdtext, "/opengate", true)==0 && IsPlayerAdmin(playerid)) { MoveObject(gate, 2108.675293, 1955.424316, 12.415715,4); SendClientMessage(playerid, 0xFFFFFFFF,"Gate Is Opening!"); return 1; } if (strcmp(cmdtext, "/closegate", true)==0 && IsPlayerAdmin(playerid)) { MoveObject(gate, 2108.686279, 1968.844116, 12.438099,4); SendClientMessage(playerid, 0xFFFFFFFF,"Gate Closing!"); return 1; } //Admin Elevator if (strcmp(cmdtext, "/goup", true)==0 && IsPlayerAdmin(playerid)) { MoveObject(elevator1, 2000.085571, 1874.622803, 124.478325,4); MoveObject(elevator2, 1999.498901, 1875.523438, 123.378258,4); MoveObject(elevator3, 1998.897095, 1876.432983, 124.453461,4); SendClientMessage(playerid, 0xFFFFFFFF,"The Elevator Is Goes Up!"); return 1; } if (strcmp(cmdtext, "/godown", true)==0 && IsPlayerAdmin(playerid)) { MoveObject(elevator1, 2000.085571, 1874.622803, 27.653271,4); MoveObject(elevator2, 1999.498901, 1875.523438, 26.528265,4); MoveObject(elevator3, 1998.897095, 1876.432983, 27.603275,4); SendClientMessage(playerid, 0xFFFFFFFF,"The Elevator Is Goes Down!"); return 1; } //Admin Spawn if (strcmp(cmdtext, "/aspawn", true)==0 && IsPlayerAdmin(playerid)) { SetPlayerPos(playerid, 2018.2966, 1916.3411, 12.3418); return 1; } |
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
//Admin Gate
if (strcmp(cmdtext, "/opengate", true)==0 && IsPlayerAdmin(playerid))
{
MoveObject(gate, 2108.675293, 1955.424316, 12.415715,4);
SendClientMessage(playerid, 0xFFFFFFFF,"Gate Is Opening!");
return 1;
}
if (strcmp(cmdtext, "/closegate", true)==0 && IsPlayerAdmin(playerid))
{
MoveObject(gate, 2108.686279, 1968.844116, 12.438099,4);
SendClientMessage(playerid, 0xFFFFFFFF,"Gate Closing!");
return 1;
}
//Admin Elevator
if (strcmp(cmdtext, "/goup", true)==0 && IsPlayerAdmin(playerid))
{
MoveObject(elevator1, 2000.085571, 1874.622803, 124.478325,4);
MoveObject(elevator2, 1999.498901, 1875.523438, 123.378258,4);
MoveObject(elevator3, 1998.897095, 1876.432983, 124.453461,4);
SendClientMessage(playerid, 0xFFFFFFFF,"The Elevator Is Goes Up!");
return 1;
}
if (strcmp(cmdtext, "/godown", true)==0 && IsPlayerAdmin(playerid))
{
MoveObject(elevator1, 2000.085571, 1874.622803, 27.653271,4);
MoveObject(elevator2, 1999.498901, 1875.523438, 26.528265,4);
MoveObject(elevator3, 1998.897095, 1876.432983, 27.603275,4);
SendClientMessage(playerid, 0xFFFFFFFF,"The Elevator Is Goes Down!");
return 1;
}
//Admin Spawn
if (strcmp(cmdtext, "/aspawn", true)==0 && IsPlayerAdmin(playerid))
{
SetPlayerPos(playerid, 2018.2966, 1916.3411, 12.3418);
return 1;
}
return 0;
}