SA-MP Forums Archive
Help plz !! /para command. - 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: Help plz !! /para command. (/showthread.php?tid=149486)



Help plz !! /para command. - Yaszine - 22.05.2010

Hi all
pawn Код:
if(strcmp(cmdtext,"/para", true) ==0 )
 {
 GivePlayerWeapon(playerid,46,0);
 SendClientMessage(playerid,COLOR_YELLOW,"Parachute crйe.");
 return 1;
 }
But in the Game, when i writing /para = SERVER:Unknown Command
?? some one can help me



Re: Help plz !! /para command. - Gamer_Z - 22.05.2010

show your onplayercommandtext public... the begining and the end, and a few lines before and after this cmd.
btw it can be thst some filterscript block it, they ex return 0; befor you can execute the gamemode commands...
i supose all GM commands work all right?


Re: Help plz !! /para command. - ViruZZzZ_ChiLLL - 22.05.2010

Hmmm.. Try this maybe?

pawn Код:
if (strcmp("/para", cmdtext, true, 5) == 0)
{
 GivePlayerWeapon(playerid,46,0);
 SendClientMessage(playerid,COLOR_YELLOW,"Parachute crйe.");
 return 1;
}
Quote:
Originally Posted by gamer_Z
show your onplayercommandtext public... the begining and the end, and a few lines before and after this cmd.
btw it can be thst some filterscript block it, they ex return 0; befor you can execute the gamemode commands...
i supose all GM commands work all right?



Re: Help plz !! /para command. - Gamer_Z - 22.05.2010

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Hmmm.. Try this maybe?

pawn Код:
if (strcmp("/para", cmdtext, true, 5) == 0)
{
 GivePlayerWeapon(playerid,46,0);
 SendClientMessage(playerid,COLOR_YELLOW,"Parachute crйe.");
 return 1;
}
Quote:
Originally Posted by gamer_Z
show your onplayercommandtext public... the begining and the end, and a few lines before and after this cmd.
btw it can be thst some filterscript block it, they ex return 0; befor you can execute the gamemode commands...
i supose all GM commands work all right?
that 5 doesn't matter, btw why u quoted my text without respoding to it?.. lol ;x


Re: Help plz !! /para command. - Yaszine - 22.05.2010

I've
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
in the begining
&
pawn Код:
if (strcmp("/white", cmdtext, true, 10) == 0)
{
SetPlayerColor(playerid, 0xFFFFFFFF);
return 1;
}
& after that, there is /para

... more
... cmds

in the end

Код:
return SendClientMessage(playerid,COLOR_RED,"Unknown Command line");
}
Thats all



Re: Help plz !! /para command. - ViruZZzZ_ChiLLL - 22.05.2010

Quote:
Originally Posted by gamer_Z
Quote:
Originally Posted by ViruZZzZ_ChiLLL
Hmmm.. Try this maybe?

pawn Код:
if (strcmp("/para", cmdtext, true, 5) == 0)
{
 GivePlayerWeapon(playerid,46,0);
 SendClientMessage(playerid,COLOR_YELLOW,"Parachute crйe.");
 return 1;
}
Quote:
Originally Posted by gamer_Z
show your onplayercommandtext public... the begining and the end, and a few lines before and after this cmd.
btw it can be thst some filterscript block it, they ex return 0; befor you can execute the gamemode commands...
i supose all GM commands work all right?
that 5 doesn't matter, btw why u quoted my text without respoding to it?.. lol ;x
I know that 5 doesn't matter XD and because that was my answer too.


Re: Help plz !! /para command. - Gamer_Z - 22.05.2010

Quote:
Originally Posted by Yaszine
I've
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
in the begining
&
pawn Код:
if (strcmp("/white", cmdtext, true, 10) == 0)
{
SetPlayerColor(playerid, 0xFFFFFFFF);
return 1;
}
& after that, there is /para

... more
... cmds

in the end

Код:
return SendClientMessage(playerid,COLOR_RED,"Unknown Command line");
}
Thats all
with begining end and middle i meant this:

pawn Код:
//begin
public OnPlayerCommandText(playerid,cmdtext[]){
    #if defined SD
    printf("#0013# command used: %s",cmdtext);
    #endif
    #if defined UZYJ_SPS
    new string[256];
    if(AntySpamCMD == 1){
        if(!IsPlayerAdmin2(playerid) && !IsPlayerVIP(playerid)){
            CMDspam[playerid] ++;
            if(CMDspam[playerid] >= 3) {
                format(string,256,"[sPs] Przestaс Spamowaж Komendami! Czekasz %d sek.",CMDspam[playerid]);
                SendClientMessage(playerid,0xFFFF00AA,string);
                return 1;
            }
        }
    }
    #endif
    if(LoginRegisterCommands(playerid, cmdtext))return 1;
    new cmdname2[256],/*pname2[MAX_PLAYER_NAME],*/cmdname[256],temp[256],cmd[256],idx;
    cmd = strtok(cmdtext,idx);
    //GetPlayerName(playerid, pname2, sizeof(pname2));
    strmid(cmdname2, cmdtext, 0, strlen(cmdtext));
    //printf("zapisywanie uzytej cmd %s",cmdtext);
    ToLog(all_cmds_log,"[CMD] %s(%d) uzyl komendy %s",PlayerName(playerid),playerid,cmdname2);
    //printf("zapisano uzyte cmd %s",cmdtext);
    //komendy
    if(logged[playerid] == 0 && dini_Exists(udb_encode(PlayerName(playerid))))return SendClientMessage(playerid,CINFO,"Zaloguj sie zanim bedziesz uzywac komendy!");
    if(TajneKomendy(playerid,cmdtext))return 1;
    if(blokada[playerid] == 1)return SendClientMessage(playerid, COLOR_WHITE, "Twoje Komendy Sa Zablokowane!");
    if(PMCMDS(playerid,cmdtext))return 1;
   
    strmid(cmdname, cmdtext, 0, strlen(cmdtext));
    format(temp, sizeof(temp), "@Eye -> Komenda - %s (%d) wpisaі komendк %s", PlayerName(playerid),playerid, cmdname);
    if(HideWrittenCmds[playerid] == 0){
        for(new e=0; e<MAX_PLAYERS; e++){
            if(IsPlayerConnected(e) && IsPlayerAdmin2(e) && eye2[e] == 1){
                if(e == playerid){
                } else {
                    SendClientMessage(e, COLOR_ORANGE, temp);
                }
            }
        }
    }
   
    if(!IsPlayerAdmin2(playerid) && jailid[playerid] == 1)return SendClientMessage(playerid,CWARN,"Jestes uwieziony, poczekaj az cie admin/vip wypusci (lub odczekaj 2 min)");
  if(ZWJJcmds(playerid,cmdtext))return 1;
    if(IsZW[playerid] && !IsPlayerAdmin2(playerid))return SendClientMessage(playerid,CWARN,"Pierwsze wyjdz z ZW!");
   
    if(ZarzadzajCommands(playerid, cmdtext))return 1;
    if(BanCommands(playerid,cmdtext))return 1;
    if(AdminsCommands(playerid, cmdtext))return 1;
    if(ASCommands(playerid,cmdtext))return 1;
    if(BlockCommands(playerid,cmdtext))return 1;
    #if defined UZYJ_WWII
    if(WORLDWARCOMMANDS(playerid,cmdtext))return 1;
    if(IsInWW(playerid) && !IsHead(playerid))return SendClientMessage(playerid,CWARN,"Nie mozesz uzywac komend na WOII");
    #endif
//end
    if(IsPlayerInRP[playerid] == 1){
      //if komend rp
    }
    #if defined SD
    printf("#0013# invalid command: %s",cmdtext);
    #endif
    return SendClientFormatMessage(playerid,CDGREY,"eXe24: Nie ma takiej komendy: %s",cmd);
}
and i see your own return doesn't get called so BEFORE the /param cmd something returns 0;.. check what that is.



Re: Help plz !! /para command. - Jakku - 22.05.2010

You have something wrong in your public OnPlayerCommandText, maybe you should post it?


Re: Help plz !! /para command. - [MWR]Blood - 22.05.2010

pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext,"/para",true)==0)
{
GivePlayerWeapon(playerid,46,1);
SendClientMessage(playerid,green,"You've a parachute, enjoy.");
return 1;
}
return 0;
}



Re: Help plz !! /para command. - Gamer_Z - 22.05.2010

Quote:
Originally Posted by ikarus❶❸❸❼
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext,"/para",true)==0)
{
GivePlayerWeapon(playerid,46,1);
SendClientMessage(playerid,green,"You've a parachute, enjoy.");
return 1;
}
return 0;
}
sure this will work but then he comes and says that the next cmd doesn't work.. so if u repair something do it good...