Weapon array
#1

Hello, i am creating a duel system, and this is my sscanf line
pawn Код:
if(sscanf(params,"us[20]d",PID,sWeapon,Money))
I want to create a weapon array and add specific weapons, then to check if entered weapon = "sWeapon"
How to do that?
Reply
#2

Quote:
Originally Posted by SaYrOn
Посмотреть сообщение
Create weapon array, under command add string variable( weapon[20], for example), and then do a loop something like:

Код:
for(new i; i < sizeof(sWeapons); i++)
{
       if(strcmp(sWeapons[i], weapon) == 0)
       {
                   // Do smth if weapon that player entered is same with some weapon from the array
       }
}
Will try it thanks RPed.
Quote:
Originally Posted by ******
Посмотреть сообщение
I would say look up the "k" specifier to write a custom sscanf specifier.
Didn't know i can write a custom specifier :O
Thanks i'll take a look about sscanf topic.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)