#include <a_samp> #if defined FILTERSCRIPT new elevator; elevator = CreateObject(976,2907.84814453,-1990.46643066,0.88099957,0.00000000,0.00000000,0.00000000); public OnFilterScriptInit() { print("\n--------------------------------------"); print(" MOVE OBJECT "); print("--------------------------------------\n"); return 1; } 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
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] |
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;
}
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(3) : error 010: invalid function or declaration C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(14) : error 017: undefined symbol "cmd" C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16) : error 017: undefined symbol "COLOR_RED" C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(19) : warning 217: loose indentation C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(19) : error 017: undefined symbol "cmd" C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(21) : error 017: undefined symbol "COLOR_RED" C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(24) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
new cmd[128], idx; cmd = strtok(cmdtext, idx);
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[128], idx; cmd = strtok(cmdtext, idx);
try to put this under OnPlayerCommandText
Код:
new cmd[128], idx; cmd = strtok(cmdtext, idx); Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[128], idx; cmd = strtok(cmdtext, idx); |
C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(4) : error 010: invalid function or declaration C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16) : warning 219: local variable "cmd" shadows a variable at a preceding level C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16) : warning 219: local variable "idx" shadows a variable at a preceding level C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(17) : error 017: undefined symbol "strtok" C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(17) : error 033: array must be indexed (variable "cmd") C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(18) : warning 217: loose indentation C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(20) : error 017: undefined symbol "COLOR_RED" C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(23) : warning 217: loose indentation C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(25) : error 017: undefined symbol "COLOR_RED" C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(28) : warning 217: loose indentation C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16) : warning 203: symbol is never used: "idx" C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16 -- 31) : warning 203: symbol is never used: "cmd" C:\Documents and Settings\test\Desktop\Big Brother ™800\filterscripts\moveobj.pwn(16 -- 31) : warning 203: symbol is never used: "idx" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.