Something is wrong, but it looks like I scripted it right!
#1

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/factions", cmdtext, true, 10) == 0)
	{
            SendClientMessage(playerid, COLOR_PINK," Factions :");
	    SendClientMessage(playerid, COLOR_BLUE," Police Department");
	    SendClientMessage(playerid, COLOR_BLACK," Federal Bureau of Investigation");
	    SendClientMessage(playerid, COLOR_GREEN," National Guard");
	    SendClientMessage(playerid, COLOR_RED," Medic");
	    SendClientMessage(playerid, COLOR_PINK," The Government");
     	    SendClientMessage(playerid, COLOR_PINK," Secret Service");
      	    SendClientMessage(playerid, COLOR_ORANGE," Hitman");
       	    SendClientMessage(playerid, COLOR_LIGHTBLUE," SanFierroNews");
       	{
       	    return 1;
        }
	return 0;
}
Anyone see anything wrong in here?
Reply
#2

take a look at mine ----------- this works

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/help", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid,0x24FF0AB9,"/credits");
        SendClientMessage(playerid,0x24FF0AB9,"/vip");
        SendClientMessage(playerid,0x24FF0AB9,"/nitroinfo");
        SendClientMessage(playerid,0x24FF0AB9,"/admins");
        return 1;
    }
    if (strcmp("/t", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, 0x33CCFFFF, "Available TelePorts");
        SendClientMessage(playerid, 0x24FF0AB9, "/sf - San Fierro Airport");
        SendClientMessage(playerid, 0x24FF0AB9, "/lv - Las Vegas Airport");
        SendClientMessage(playerid, 0x24FF0AB9, "/ls - Los Santos Airport");
        SendClientMessage(playerid, 0x24FF0AB9, "/cf - CabinFever");
        SendClientMessage(playerid, 0x24FF0AB9, "/sr - SkyRoad");
        SendClientMessage(playerid, 0x24FF0AB9, "/t2 For More Teleports");
        return 1;
    }
Reply
#3

Код:
 C:\Users\Marberg\Desktop\samp server2\gamemodes\Sanfierro.pwn(106) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Now it says this..
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/factions", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, COLOR_PINK," Factions :");
        SendClientMessage(playerid, COLOR_BLUE," Police Department");
        SendClientMessage(playerid, COLOR_BLACK," Federal Bureau of Investigation");
        SendClientMessage(playerid, COLOR_GREEN," National Guard");
        SendClientMessage(playerid, COLOR_RED," Medic");
        SendClientMessage(playerid, COLOR_PINK," The Government");
        SendClientMessage(playerid, COLOR_PINK," Secret Service");
        SendClientMessage(playerid, COLOR_ORANGE," Hitman");
        SendClientMessage(playerid, COLOR_LIGHTBLUE," SanFierroNews");
        return 1;
    }
    return 1;
}
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/factions", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, COLOR_PINK," Factions :");
        SendClientMessage(playerid, COLOR_BLUE," Police Department");
        SendClientMessage(playerid, COLOR_BLACK," Federal Bureau of Investigation");
        SendClientMessage(playerid, COLOR_GREEN," National Guard");
        SendClientMessage(playerid, COLOR_RED," Medic");
        SendClientMessage(playerid, COLOR_PINK," The Government");
        SendClientMessage(playerid, COLOR_PINK," Secret Service");
        SendClientMessage(playerid, COLOR_ORANGE," Hitman");
        SendClientMessage(playerid, COLOR_LIGHTBLUE," SanFierroNews");
        return 1;
    }
    return 1;
}
Reply
#6

God damnit -.- Thank you Devil! By the way, are you working on some own project? Cuz I need some help with my san fierro roleplay server ^^
Reply
#7

warning 209: function "OnPlayerCommandText" should return a value

not 0
its 1
Reply
#8

Don't use classic cmd system for RP server.
I prefer dcmd or zcmd
even dcmd is better
Reply
#9

Quote:
Originally Posted by pixl
Посмотреть сообщение
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/factions", cmdtext, true, 10) == 0)
	{
            SendClientMessage(playerid, COLOR_PINK," Factions :");
	    SendClientMessage(playerid, COLOR_BLUE," Police Department");
	    SendClientMessage(playerid, COLOR_BLACK," Federal Bureau of Investigation");
	    SendClientMessage(playerid, COLOR_GREEN," National Guard");
	    SendClientMessage(playerid, COLOR_RED," Medic");
	    SendClientMessage(playerid, COLOR_PINK," The Government");
     	    SendClientMessage(playerid, COLOR_PINK," Secret Service");
      	    SendClientMessage(playerid, COLOR_ORANGE," Hitman");
       	    SendClientMessage(playerid, COLOR_LIGHTBLUE," SanFierroNews");
       	{
       	    return 1;
        }
	return 0;
}
Anyone see anything wrong in here?
Yup, I see wrong

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/factions", cmdtext, true, 10) == 0)
    {
            SendClientMessage(playerid, COLOR_PINK," Factions :");
        SendClientMessage(playerid, COLOR_BLUE," Police Department");
        SendClientMessage(playerid, COLOR_BLACK," Federal Bureau of Investigation");
        SendClientMessage(playerid, COLOR_GREEN," National Guard");
        SendClientMessage(playerid, COLOR_RED," Medic");
        SendClientMessage(playerid, COLOR_PINK," The Government");
            SendClientMessage(playerid, COLOR_PINK," Secret Service");
            SendClientMessage(playerid, COLOR_ORANGE," Hitman");
            SendClientMessage(playerid, COLOR_LIGHTBLUE," SanFierroNews");
        {//WRONG BRACKET
            return 1; //Return should come first
        }
    return 0;
}
FIX :
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/factions", cmdtext, true, 10) == 0)
    {
            SendClientMessage(playerid, COLOR_PINK," Factions :");
        SendClientMessage(playerid, COLOR_BLUE," Police Department");
        SendClientMessage(playerid, COLOR_BLACK," Federal Bureau of Investigation");
        SendClientMessage(playerid, COLOR_GREEN," National Guard");
        SendClientMessage(playerid, COLOR_RED," Medic");
        SendClientMessage(playerid, COLOR_PINK," The Government");
            SendClientMessage(playerid, COLOR_PINK," Secret Service");
            SendClientMessage(playerid, COLOR_ORANGE," Hitman");
            SendClientMessage(playerid, COLOR_LIGHTBLUE," SanFierroNews");
            return 1;
        }
           
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)