• Welcome to Vice City Multiplayer.
 

[PAWN]Bug list 0.3z

Started by Relax, July 06, 2010, 04:46:55 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

[Saint]

please fix Callback OnPlayerText

Returning 0 in this callback will stop the text from being sent, not work  :(

88.83.197.243:7778

Jancis71

Quote from: [Saint] on August 02, 2010, 10:08:19 PM
please fix Callback OnPlayerText

Returning 0 in this callback will stop the text from being sent, not work  :(

in 0.4 version, this is done.. i think.

PlayerX

cmds in OnPlayerText(playerid, text[]) with 2 params or more, not work.

public OnPlayerText(playerid, text[])
{
     if(text[0] == !)
     {
          new tmp[64], idx;
          tmp = strtok(text, idx);
          commands(playerid, 0, tmp, text[strlen(tmp) + 1]);
     }
     return 1;
}

public OnPlayerCommand(playerid, cmdtext[])
{
     new tmp[64], idx;
     tmp = strtok(text, idx);
     commands(playerid, 1, tmp, text[strlen(tmp) + 1]);
     return 1;
}

stock CmdType(type, string[])
{
     new str[128];
     if(type == 1) format(str, sizeof(str), "* Usage: /c %s", string);
     else format(str,sizeof(str), "* Usage: !%s", string);
     return str;
}

public commands(playerid, type, cmd[], params[])
{
     if(strcmp(params, "wep",true))
     {
           new weapon[64], ammo[4], wid, am, msg[128];
           if(sscanf(params,"sz",weapon, ammo)) return SendMessageToPlayer(playerid, CFG_Color, CmdType(type, "wep <WeaponName/WeaponID> <Ammo>"));
           wid = ReturnWeapon(weapon);
           if(wid == -1) return SendMessageToPlayer(playerid, CFG_Color, ">> Error: Invalid Weapon!");
           if(!strlen(ammo) || !IsNumeric(ammo)) am = 500;
           else am = strval(ammo);
           format(msg, 128, ">> Weapon Name: %s - Ammo: %d", wid, am);
           SendMessageToPlayer(playerid, CFG_Color, msg);
           GivePlayerWeapon(playerid, wid, am);
     }
     return 1;
}

[Saint]

#18
function


  • GetPlayerWeapon(playerid);

not working  :(

if use this function on yours pwn code => server dont load your amx gamemode

88.83.197.243:7778