Raised This Month: $51 Target: $400
 12% 

Mix the string in switch-case


Post New Thread Reply   
 
Thread Tools Display Modes
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 09-20-2014 , 08:06   Re: Mix the string in switch-case
Reply With Quote #11

PHP Code:
new String:sDisplay[512], String:sItem[9][32];

FormatEx(sItem[0], sizeof(sItem[]), "Health Regen");
FormatEx(sItem[1], sizeof(sItem[]), "First Aid for your Team");
FormatEx(sItem[2], sizeof(sItem[]), "Adrenaline");
FormatEx(sItem[3], sizeof(sItem[]), "Knife");
FormatEx(sItem[4], sizeof(sItem[]), "M16");
FormatEx(sItem[5], sizeof(sItem[]), "Ammo");
FormatEx(sItem[6], sizeof(sItem[]), "M16");
FormatEx(sItem[7], sizeof(sItem[]), "AK47");
FormatEx(sItem[8], sizeof(sItem[]), "Nothing");

FormatEx(sDisplaysizeof(sDisplay), "{blue}%N{default}: Has gotten: "iClient);

for (new 
1<= 10i++)
{
    new 
iResult GetRandomInt(08)
    
    if (
== 3Format(sDisplaysizeof(sDisplay), "%s{olive}%s{default}"sDisplaysItem[iResult]);

    
Format(sDisplaysizeof(sDisplay), "%s{olive}%s{default}, "sDisplaysItem[iResult]);
}

CPrintToChatAll(sDisplay); 
Marcus_Brown001 is offline
gilmon
Senior Member
Join Date: Feb 2011
Location: China
Old 09-20-2014 , 08:28   Re: Mix the string in switch-case
Reply With Quote #12

Very thanks to this, it's work!
gilmon is offline
Send a message via MSN to gilmon
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 09-20-2014 , 10:25   Re: Mix the string in switch-case
Reply With Quote #13

Obviously change the loop conditions if you want the player to get more or less options. Glad I could help.
Marcus_Brown001 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode