#1

http://platzii.com/pastebin/110

I can sell to invalid id's

like
/sellgun 3153 mp5

it gives me mp5
Reply
#2

You need to have this

Код:
tmp = strtok(cmdtext, idx);

giveplayerid = strval(tmp);
before you use "giveplayerid"

So put that at thetop ofyour command and you should be ok
Reply
#3

you need to add if(IsPlayerConnected(giveplayerid)) too
Reply
#4

http://platzii.com/pastebin/111

it sends me those lines in chat:
Код:
          SendClientMessage(playerid, COLOR_WHITE, "*** Sell Guns ***");
          SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellgun [id] [gun]");
          SendClientMessage(playerid, COLOR_GREY, "AVAILABLE GUNS**:mp5, m4, deagle, shotgun, ak47, 9mm");
          SendClientMessage(playerid, COLOR_GREY, "ERROR: Wrong ID OR WRONG WEAPON NAME");
when i type /sellgun 0 mp5
Reply
#5

bump
Reply
#6

Код:
 if(strcmp(cmd, "/sellgun", true) == 0) {
    GetPlayerPos(giveplayerid,px,py,pz);
    tmp = strtok(cmd, idx);
    if(!strlen(tmp)) {
      SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
      SendClientMessage(playerid, COLOR_WHITE, "*** Sell Guns ***");
      SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellgun [id] [gun]");
      SendClientMessage(playerid, COLOR_GREY, "AVAILABLE GUNS**:mp5, m4, deagle, shotgun, ak47, 9mm");
      SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
      return 1;
    }
    if (IsPlayerConnected(giveplayerid))
        {
      if(giveplayerid != INVALID_PLAYER_ID) {
        x_info = strtok(cmd, idx);
        if(!strlen(x_info)) {
          SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
          SendClientMessage(playerid, COLOR_WHITE, "*** Sell Guns ***");
          SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellgun [id] [gun]");
          SendClientMessage(playerid, COLOR_GREY, "AVAILABLE GUNS**:mp5, m4, deagle, shotgun, ak47, 9mm");
          SendClientMessage(playerid, COLOR_GREY, "ERROR: Wrong ID OR WRONG WEAPON NAME");
          SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
          return 1;
        }
      }
does this work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)