#1

I have tryed to make organizations but i need help . This was my OnPlayerTextCommand :
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/help", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, 0xFF8080FF, "Komande :");
		SendClientMessage(playerid, 0xFF8080FF, "Animacije i loto: /animlist , /kupilistic , ");
		return 1;
	}
	return 0;
}
And I need to put this command :
Код:
COMMAND:kickmember(playerid, params[])
{
    new id;
    if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /kickmember [id]");
    GetPlayerName(playerid, Name, sizeof(Name));
    if(Member[id] == 1 && Leader[playerid] == 1)
    {
        format(String, sizeof(String), "%s has kicked you from San Andreas Police Dept.",Name);
        SendClientMessage(id,0xFF0000FF, String);
        SetPlayerColor(id,0xFFFFFFFF);
        ResetPlayerWeapons(id);
        Leader[id] = 0;
        Member[id] = 0;
        IsInOrg[id] = 0;
        OrgId[id] = 0;
        IsLaw[id] = 0;
        IsPriv[id] = 0;
        IsGang[id] = 0;
        IsRequesting[id] = 0;
        request[id] = 0;
        format(String, sizeof(String), "You have kicked a player from San Andreas Police Dept",Name);
        SendClientMessage(playerid,0xFF0000FF, String);
        TogglePlayerControllable(id,true);
    }
    if(Member[id] == 2 && Leader[playerid] == 2)
    {
        format(String, sizeof(String), "%s has kicked you from San Andreas Street Racers.",Name);
        SendClientMessage(id,0xFF0000FF, String);
        SetPlayerColor(id,0xFFFFFFFF);
        ResetPlayerWeapons(id);
        Leader[id] = 0;
        Member[id] = 0;
        IsInOrg[id] = 0;
        OrgId[id] = 0;
        IsLaw[id] = 0;
        IsPriv[id] = 0;
        IsGang[id] = 0;
        IsRequesting[id] = 0;
        request[id] = 0;
        format(String, sizeof(String), "You have kicked a player from San Andreas Street Racers.",Name);
        SendClientMessage(playerid,0xFF0000FF, String);
        TogglePlayerControllable(id,true);
    }
    return 1;
}
So it looks like this when I put second command :

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/help", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, 0xFF8080FF, "Komande :");
		SendClientMessage(playerid, 0xFF8080FF, "Animacije i loto: /animlist , /kupilistic , ");
		return 1;
	}
    COMMAND:kickmember(playerid, params[])
{
    new id;
    if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /kickmember [id]");
    GetPlayerName(playerid, Name, sizeof(Name));
    if(Member[id] == 1 && Leader[playerid] == 1)
    {
        format(String, sizeof(String), "%s has kicked you from San Andreas Police Dept.",Name);
        SendClientMessage(id,0xFF0000FF, String);
        SetPlayerColor(id,0xFFFFFFFF);
        ResetPlayerWeapons(id);
        Leader[id] = 0;
        Member[id] = 0;
        IsInOrg[id] = 0;
        OrgId[id] = 0;
        IsLaw[id] = 0;
        IsPriv[id] = 0;
        IsGang[id] = 0;
        IsRequesting[id] = 0;
        request[id] = 0;
        format(String, sizeof(String), "You have kicked a player from San Andreas Police Dept",Name);
        SendClientMessage(playerid,0xFF0000FF, String);
        TogglePlayerControllable(id,true);
    }
    if(Member[id] == 2 && Leader[playerid] == 2)
    {
        format(String, sizeof(String), "%s has kicked you from San Andreas Street Racers.",Name);
        SendClientMessage(id,0xFF0000FF, String);
        SetPlayerColor(id,0xFFFFFFFF);
        ResetPlayerWeapons(id);
        Leader[id] = 0;
        Member[id] = 0;
        IsInOrg[id] = 0;
        OrgId[id] = 0;
        IsLaw[id] = 0;
        IsPriv[id] = 0;
        IsGang[id] = 0;
        IsRequesting[id] = 0;
        request[id] = 0;
        format(String, sizeof(String), "You have kicked a player from San Andreas Street Racers.",Name);
        SendClientMessage(playerid,0xFF0000FF, String);
        TogglePlayerControllable(id,true);
    }
    return 1;
}
	return 0;
}
And it looks like this :
Код:
C:\DOCUME~1\Emrah\Desktop\RIVERS~1\GAMEMO~1\RIVERS~2.PWN(272) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Emrah\Desktop\RIVERS~1\GAMEMO~1\RIVERS~2.PWN(272) : error 017: undefined symbol "cmd_kickmember"
C:\DOCUME~1\Emrah\Desktop\RIVERS~1\GAMEMO~1\RIVERS~2.PWN(272) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Emrah\Desktop\RIVERS~1\GAMEMO~1\RIVERS~2.PWN(272) : 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
#2

Try using zcmd.
Also, you can't mix strtok and zcmd. (or any alternating command procssors)
When you use zcmd, don't place it in ANY public, but put it at the bottem of your script.
And don't forget to #include <zcmd> on top

A regular zcmd command looks like this:

Код:
CMD:yourcommandhere(playerid, params[])
{
        // do something here
       return 1;
}
the return 1; is also from mayor importance, leaving it away will cause an error

Hope this helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)