SA-MP Forums Archive
[HELP] What is wrong with THIS 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] What is wrong with THIS command? (/showthread.php?tid=85721)



[HELP] What is wrong with THIS command? - Spatman - 09.07.2009

Hey, i made my own command, i really need to make this command work... WHen i type /givegatekey then nothing happens, it wont say even "Player is not near you" or anything..

pawn Код:
if(strcmp(cmd, "/givegatekey", true) == 0)
    {
      giveplayerid = ReturnUser(tmp);
      if(IsPlayerConnected(giveplayerid))
        {
        if(PlayerInfo[playerid][pLeader] == 5)
            {
          if(giveplayerid != INVALID_PLAYER_ID)
                {
            new Float:x, Float:y, Float:z;
            GetPlayerPos(giveplayerid,x,y,z);
            if(!PlayerToPoint(15, playerid, x, y, z))
                    {
              SendClientMessage(playerid, COLOR_GRAD1, " Player is not near you!");
              return 1;
            }
            if(PlayerInfo[giveplayerid][pGatekey1] == 1)
                    {
              SendClientMessage(playerid, COLOR_GRAD1, " Player already haves your gate key!");
              return 1;
            }
            PlayerInfo[giveplayerid][pGatekey1] = 1;
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes hes gates remote controller, and gives it to %s.", sendername ,giveplayer);
            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
          }
            }
        else if(PlayerInfo[playerid][pLeader] == 9)
            {
          if(giveplayerid != INVALID_PLAYER_ID)
                {
            new Float:x, Float:y, Float:z;
            GetPlayerPos(giveplayerid,x,y,z);
            if(!PlayerToPoint(15, playerid, x, y, z))
                    {
              SendClientMessage(playerid, COLOR_GRAD1, " Player is not near you!");
              return 1;
            }
            if(PlayerInfo[giveplayerid][pGatekey2] == 1)
                    {
              SendClientMessage(playerid, COLOR_GRAD1, " Player already haves your gate key!");
              return 1;
            }
            PlayerInfo[giveplayerid][pGatekey2] = 1;
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes hes gates remote controller, and gives it to %s.", sendername ,giveplayer);
            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
          }
            }



Re: [HELP] What is wrong with THIS command? - Westie - 09.07.2009

I'm presuming that tmp[] is not being filled with the user's name nor playerid, so that might your problem.


Re: [HELP] What is wrong with THIS command? - Spatman - 09.07.2009

Quote:
Originally Posted by /^We(stie|z+[e|a
r)$/ ]
I'm presuming that tmp[] is not being filled with the user's name nor playerid, so that might your problem.
What do you mean?


Re: [HELP] What is wrong with THIS command? - Spatman - 09.07.2009

Help please


Re: [HELP] What is wrong with THIS command? - Spatman - 09.07.2009

Sorry for triple post, but does anyone know ?


Re: [HELP] What is wrong with THIS command? - Correlli - 09.07.2009

There's no need for spaming.


Re: [HELP] What is wrong with THIS command? - Spatman - 09.07.2009

Quote:
Originally Posted by Don Correlli
There's no need for spaming.
Yes youre right. But "bumping" would be better that making new topic i guess?
But yeah, ill let this topic "die" then, if no one cant help me...


Re: [HELP] What is wrong with THIS command? - Westie - 10.07.2009

Use something like strtok. Job done.


Re: [HELP] What is wrong with THIS command? - Spatman - 10.07.2009

Quote:
Originally Posted by /^We(stie|z+[e|a
r)$/ ]
Use something like strtok. Job done.
If you think its that easy, why dont you show it?