SA-MP Forums Archive
Commands arent working? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Commands arent working? (/showthread.php?tid=164578)



Commands arent working? - Luis_Leone - 01.08.2010

I made a /team command

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/team", cmdtext, true, 5) == 0)
        {
			SendClientMessage(playerid, COLOR_WHITE,"LS-RP Team");
   			SendClientMessage(playerid, COLOR_WHITE,"Server/Scripter - Luis");
	        SendClientMessage(playerid, COLOR_WHITE,"Co-Scripter's iViking and Ed");
	        return 1;
        }
        return 0;
}
But i type it IG and it says it is Unknown?


Re: Commands arent working? - Kevin_Joshen - 01.08.2010

Try using this;

Код:
    }
        if(!strcmp(cmdtext, "/team", true)) {
 		SendClientMessage(playerid, COLOR_WHITE,"LS-RP Team");
   		SendClientMessage(playerid, COLOR_WHITE,"Server/Scripter - Luis");
	        SendClientMessage(playerid, COLOR_WHITE,"Co-Scripter's iViking and Ed");
        return 1;
    }



Re: Commands arent working? - Luis_Leone - 01.08.2010

Quote:
Originally Posted by Kevin_Joshen
Посмотреть сообщение
Try using this;

Код:
    }
        if(!strcmp(cmdtext, "/team", true)) {
 		SendClientMessage(playerid, COLOR_WHITE,"LS-RP Team");
   		SendClientMessage(playerid, COLOR_WHITE,"Server/Scripter - Luis");
	        SendClientMessage(playerid, COLOR_WHITE,"Co-Scripter's iViking and Ed");
        return 1;
    }
Still dont work, Idk why.


Re: Commands arent working? - Kevin_Joshen - 01.08.2010

what does it say when you compile it? and do you have COLOR_WHITE defined?


Re: Commands arent working? - Luis_Leone - 01.08.2010

Quote:
Originally Posted by Kevin_Joshen
Посмотреть сообщение
what does it say when you compile it? and do you have COLOR_WHITE defined?
Yes i have it Defined, It has some Warnings but they have nothing to do with the cmds?


Re: Commands arent working? - Kar - 01.08.2010

show them thats why


Re: Commands arent working? - Luis_Leone - 01.08.2010

Quote:
Originally Posted by Kar
Посмотреть сообщение
show them thats why
I dont understand?


Re: Commands arent working? - Kar - 01.08.2010

show the warnings..


Re: Commands arent working? - Luis_Leone - 01.08.2010

Here's the errors
Код:
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LS-RP1.pwn(85) : warning 213: tag mismatch
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LS-RP1.pwn(85) : warning 202: number of arguments does not match definition
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LS-RP1.pwn(350) : warning 203: symbol is never used: "BData"
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LS-RP1.pwn(350) : warning 203: symbol is never used: "HouseData"
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LS-RP1.pwn(350) : warning 203: symbol is never used: "IsNumeric"
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LS-RP1.pwn(350) : warning 203: symbol is never used: "PlayerData"
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LS-RP1.pwn(350) : warning 203: symbol is never used: "ReturnUser"
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LS-RP1.pwn(350) : warning 203: symbol is never used: "VehicleData"
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LS-RP1.pwn(350) : warning 203: symbol is never used: "ret_memcpy"
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LS-RP1.pwn(350) : warning 203: symbol is never used: "strtok"
Also i have changed to a /o cmd

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(o, 1, cmdtext);
  return 1;
}

dcmd_o(playerid, params[])
{
  if(!strlen(params)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /o [chat]");
  new str[256];
  GetPlayerName(playerid, str, sizeof(str));
  format(str, sizeof(str), "%s: %s", str, params);
  SendClientMessageToAll(COLOR_WHITE, str);
  return 1;
}



Re: Commands arent working? - Kar - 01.08.2010

line 85 please?