14.04.2011, 16:39
Quote:
Guys,i need help with this,when i join game and type /up there says unknown command
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmd, "/up", true) == 0) { MoveObject(elevator,2907.84814453,-1990.46643066,0.88099957,2.00); // Put your cords in here SendClientMessage(playerid, COLOR_RED, "You are now going up, Please Wait."); // You dont alwas have to put this in, delete if wanted. return 1; } if(strcmp(cmd, "/down", true) == 0) { // Same deal as before MoveObject(elevator,2907.84814453,-1990.46643066,0.88099957,-2.00); // Same deal as before SendClientMessage(playerid, COLOR_RED, "The Elevator is now comming, Please Wait."); // Same deal as before return 1; } #endif[/code] |
it should be Like this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/up", true) == 0) {
MoveObject(elevator,2907.84814453,-1990.46643066,0.88099957,2.00); // Put your cords in here
SendClientMessage(playerid, COLOR_RED, "You are now going up, Please Wait."); // You dont alwas have to put this in, delete if wanted.
return 1;
}
if(strcmp(cmd, "/down", true) == 0) { // Same deal as before
MoveObject(elevator,2907.84814453,-1990.46643066,0.88099957,-2.00); // Same deal as before
SendClientMessage(playerid, COLOR_RED, "The Elevator is now comming, Please Wait."); // Same deal as before
return 1;
}
return 0;
}
you missed
return 0;
over there.