Como hacer comandos para poner pack de armas
#3

Tambiйn puedes hacer /armas 1 /armas 2 etc..
pawn Код:
if(strcmp(cmdtext, "/armas", true)==0)
{
new idx;
new tmp = strtok(cmdtext, idx);
if(tmp=="1")
{
GivePlayerWeapon(playerid, idarma, balas);
GivePlayerWeapon(playerid, idarma, balas);
}
if(tmp=="2")
{
//GivePlayerWeapon
}
return 1;
}


stock strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)