How to convert this into a strcmp
#6

Quote:
Originally Posted by Blackazur
Посмотреть сообщение
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    	if (strcmp("/setscore", cmdtext, true) == 0)
   {
    if (PlayerInfo[playerid][level] <3 && IsPlayerAdmin(playerid) == 0) return SendClientMessage(playerid,COLOR_RED,"You need to be a full administrator to use this command!");
    new id,val,string[128];
    if (sscanf(params,"ii",id,val)) return SendClientMessage(playerid,COLOR_GREEN,"Usage: /setscore [playerid] [value]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"Player is not connected");
    if(playerid == id) return SendClientMessage(playerid,COLOR_RED,"Don't abuse");
    SetPlayerScore(id,val);
    new pName[MAX_PLAYER_NAME];
    new vName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,32);
    GetPlayerName(id,vName,32);
    format(string,sizeof string,"{FF0A00}-[Administrator: %s]- {FFFFFF}changed %s's score to %i.",pName,vName,val);
    SendClientMessageToAll(COLOR_GRAY,string);
    return 1;
}
But i dont think that Commands with Parameters work with strcmp.
Look:
Код:
DM.pwn(1007) : error 029: invalid expression, assumed zero
C:\WINDOWS\security\kidn\Server\Global DM [0.3x]\gamemodes\DM.pwn(1007) : warning 215: expression has no effect
C:\WINDOWS\security\kidn\Server\Global DM [0.3x]\gamemodes\DM.pwn(1007) : error 001: expected token: ";", but found "]"
C:\WINDOWS\security\kidn\Server\Global DM [0.3x]\gamemodes\DM.pwn(1007) : error 029: invalid expression, assumed zero
C:\WINDOWS\security\kidn\Server\Global DM [0.3x]\gamemodes\DM.pwn(1007) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply


Messages In This Thread
How to convert this into a strcmp - by RiChArD_A - 25.01.2013, 21:31
Re: How to convert this into a strcmp - by MP2 - 25.01.2013, 21:34
Respuesta: Re: How to convert this into a strcmp - by RiChArD_A - 25.01.2013, 21:43
AW: How to convert this into a strcmp - by Blackazur - 25.01.2013, 21:44
Re: Respuesta: Re: How to convert this into a strcmp - by Neil. - 25.01.2013, 21:48
Respuesta: AW: How to convert this into a strcmp - by RiChArD_A - 25.01.2013, 21:56
Re: How to convert this into a strcmp - by Neil. - 25.01.2013, 21:58
Re: How to convert this into a strcmp - by Rayan_black - 25.01.2013, 21:59
Respuesta: How to convert this into a strcmp - by RiChArD_A - 25.01.2013, 22:19
Re: Respuesta: How to convert this into a strcmp - by Neil. - 25.01.2013, 22:22

Forum Jump:


Users browsing this thread: 2 Guest(s)