• Welcome to Vice City Multiplayer.
 

Calculator Script!

Started by BIG[H], March 18, 2011, 03:22:10 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

BIG[H]

Sup?? Poor in Math huh??
add this =
Quoteelse if (strcmp(cmd, "cadd", true) == 0) {
      new tmp2[128], tmp3[128];
      tmp3 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
      if (!strlen(tmp2)) { SendClientMessage(playerid,COLOR_GREEN, "USAGE: /c cadd [value1] [value2]"); }
      else if((!isnumeric(tmp2)) ||  (!isnumeric(tmp3))) SendClientMessage(playerid,COLOR_GREEN, "Error : Both Values Must Be Numeric");

      else {   new string[256];
new Float:ansa;
ansa = floatadd(floatstr(tmp2),floatstr(tmp3));
      format(string,256,"You answer is [Addition][%s] + [%s]  = [%f]",tmp2,tmp3,ansa);
         SendClientMessage(playerid,Green,string);
      
      }
      return 1;
      }
         else if (strcmp(cmd, "csub", true) == 0) {
      new tmp2[128], tmp3[128];
      tmp3 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
      if (!strlen(tmp2)) { SendClientMessage(playerid,COLOR_GREEN, "USAGE: /c cadd [value1] [value2]"); }
      else if((!isnumeric(tmp2)) ||  (!isnumeric(tmp3))) SendClientMessage(playerid,COLOR_GREEN, "Error : Both Values Must Be Numeric");
      else {
         new string[256];
new Float:ansa;
ansa = floatsub(floatstr(tmp2),floatstr(tmp3));
      format(string,256,"You answer is [Subtration][%s] - [%s]  = [%f]",tmp2,tmp3,ansa);
         SendClientMessage(playerid,Green,string);
         new zss[256];
      }
      return 1;
      }
         else if (strcmp(cmd, "cmul", true) == 0) {
      new tmp2[128], tmp3[128];
      tmp3 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
      if (!strlen(tmp2)) { SendClientMessage(playerid,COLOR_GREEN, "USAGE: /c cadd [value1] [value2]"); }
      else if((!isnumeric(tmp2)) ||  (!isnumeric(tmp3))) SendClientMessage(playerid,COLOR_GREEN, "Error : Both Values Must Be Numeric");
      else {
         new string[256];
new Float:ansa;
ansa = floatmul(floatstr(tmp2),floatstr(tmp3));
      format(string,256,"You answer is [Multiply][%s] X [%s]  = [%f]",tmp2,tmp3,ansa);
         SendClientMessage(playerid,Green,string);

      }
      return 1;
      }
         else if (strcmp(cmd, "cdiv", true) == 0) {
      new tmp2[128], tmp3[128];
      tmp3 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
      if (!strlen(tmp2)) { SendClientMessage(playerid,COLOR_GREEN, "USAGE: /c cadd [value1] [value2]"); }
      else if((!isnumeric(tmp2)) ||  (!isnumeric(tmp3))) SendClientMessage(playerid,COLOR_GREEN, "Error : Both Values Must Be Numeric");
      else {
         new string[256];
new Float:ansa;
ansa = floatdiv(floatstr(tmp2),floatstr(tmp3));
      format(string,256,"You answer is [Divide][%s] / [%s]  = [%f]",tmp2,tmp3,ansa);
         SendClientMessage(playerid,Green,string);

      }
      return 1;
      }

At end of script if not in script add this
Quoteisnumeric(const string[])
{// mike's function
   for (new i = 0, j = strlen(string); i < j; i++) { if (string > '9' || string < '0') return 0; }
   return 1;
}
My Guru FORUM MUST VISITmegavcmp.freeforums.org

BIG[H] = BIG HaLL

Aldo

No Offense

But this is the "script show room" not "post my collection of scripts so people call me pro scripter"
That is for everybody posting these useless scripts
Paruni VC:MP Leader
Join Today: 178.63.52.144:5193
The Only Pawn Server With Clan Protection

BIG[H]

My Guru FORUM MUST VISITmegavcmp.freeforums.org

BIG[H] = BIG HaLL

yazeen

Quote from: BIG[H] on March 18, 2011, 03:22:10 PM
Sup?? Poor in Math huh??
add this =
Quoteelse if (strcmp(cmd, "cadd", true) == 0) {
      new tmp2[128], tmp3[128];
      tmp3 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
      if (!strlen(tmp2)) { SendClientMessage(playerid,COLOR_GREEN, "USAGE: /c cadd [value1] [value2]"); }
      else if((!isnumeric(tmp2)) ||  (!isnumeric(tmp3))) SendClientMessage(playerid,COLOR_GREEN, "Error : Both Values Must Be Numeric");

      else {   new string[256];
new Float:ansa;
ansa = floatadd(floatstr(tmp2),floatstr(tmp3));
      format(string,256,"You answer is [Addition][%s] + [%s]  = [%f]",tmp2,tmp3,ansa);
         SendClientMessage(playerid,Green,string);
      
      }
      return 1;
      }
         else if (strcmp(cmd, "csub", true) == 0) {
      new tmp2[128], tmp3[128];
      tmp3 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
      if (!strlen(tmp2)) { SendClientMessage(playerid,COLOR_GREEN, "USAGE: /c cadd [value1] [value2]"); }
      else if((!isnumeric(tmp2)) ||  (!isnumeric(tmp3))) SendClientMessage(playerid,COLOR_GREEN, "Error : Both Values Must Be Numeric");
      else {
         new string[256];
new Float:ansa;
ansa = floatsub(floatstr(tmp2),floatstr(tmp3));
      format(string,256,"You answer is [Subtration][%s] - [%s]  = [%f]",tmp2,tmp3,ansa);
         SendClientMessage(playerid,Green,string);
         new zss[256];
      }
      return 1;
      }
         else if (strcmp(cmd, "cmul", true) == 0) {
      new tmp2[128], tmp3[128];
      tmp3 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
      if (!strlen(tmp2)) { SendClientMessage(playerid,COLOR_GREEN, "USAGE: /c cadd [value1] [value2]"); }
      else if((!isnumeric(tmp2)) ||  (!isnumeric(tmp3))) SendClientMessage(playerid,COLOR_GREEN, "Error : Both Values Must Be Numeric");
      else {
         new string[256];
new Float:ansa;
ansa = floatmul(floatstr(tmp2),floatstr(tmp3));
      format(string,256,"You answer is [Multiply][%s] X [%s]  = [%f]",tmp2,tmp3,ansa);
         SendClientMessage(playerid,Green,string);

      }
      return 1;
      }
         else if (strcmp(cmd, "cdiv", true) == 0) {
      new tmp2[128], tmp3[128];
      tmp3 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
      if (!strlen(tmp2)) { SendClientMessage(playerid,COLOR_GREEN, "USAGE: /c cadd [value1] [value2]"); }
      else if((!isnumeric(tmp2)) ||  (!isnumeric(tmp3))) SendClientMessage(playerid,COLOR_GREEN, "Error : Both Values Must Be Numeric");
      else {
         new string[256];
new Float:ansa;
ansa = floatdiv(floatstr(tmp2),floatstr(tmp3));
      format(string,256,"You answer is [Divide][%s] / [%s]  = [%f]",tmp2,tmp3,ansa);
         SendClientMessage(playerid,Green,string);

      }
      return 1;
      }

At end of script if not in script add this
Quoteisnumeric(const string[])
{// mike's function
   for (new i = 0, j = strlen(string); i < j; i++) { if (string > '9' || string < '0') return 0; }
   return 1;
}
Niceeeeeeeeeeeeeeeeeeeeeeeeee

yazeen

I can make a clan protection aldo its simple

i need time to make ill give a example

new n[9]; GetPlayerName(playerid,n,9);
            if(!strcmp(n,"[AsS]"))
{
SendClientMessage(playerid,COLOR_RED,"Welcome to the server);
}
else
{
Kick(playerid);
SendClientMessage(playerid,COLOR_RED,"You are not in [AsS] clan");


u can do do this for all clans use general discussion in vcmp forum to find clans !! Simple


heekz.shadow

Making a lil quote.

Yazeen.It would be bugged cuz you setted 9

It need to be 5

Including [] and AsS

Respectfully
heekz.shadow


Pro Scripter[/b][/i][/u]

yazeen

Quote from: yazeen on March 20, 2011, 04:41:50 AM
I can make a clan protection aldo its simple

i need time to make ill give a example

new n[9]; GetPlayerName(playerid,n,9);
            if(!strcmp(n,"[AsS]"))
{
SendClientMessage(playerid,COLOR_RED,"Welcome to the server);
}
else
{
Kick(playerid);
SendClientMessage(playerid,COLOR_RED,"You are not in [AsS] clan");


u can do do this for all clans use general discussion in vcmp forum to find clans !! Simple



changed

new n[9]; GetPlayerName(playerid,n,5);
            if(!strcmp(n,"[AsS]"))
{
SendClientMessage(playerid,COLOR_RED,"Welcome to the server);
}
else
{
Kick(playerid);
SendClientMessage(playerid,COLOR_RED,"You are not in [AsS] clan");


Correct heekZ?


Aldo

Quote from: yazeen on March 20, 2011, 04:41:50 AM
I can make a clan protection aldo its simple

i need time to make ill give a example

new n[9]; GetPlayerName(playerid,n,9);
           if(!strcmp(n,"[AsS]"))
{
SendClientMessage(playerid,COLOR_RED,"Welcome to the server);
}
else
{
Kick(playerid);
SendClientMessage(playerid,COLOR_RED,"You are not in [AsS] clan");


u can do do this for all clans use general discussion in vcmp forum to find clans !! Simple



Quote from: heekz.shadow on March 20, 2011, 05:56:33 AM
Making a lil quote.

Yazeen.It would be bugged cuz you setted 9

It need to be 5

Including [] and AsS

Respectfully
heekz.shadow

Quote from: yazeen on March 20, 2011, 07:17:40 AM

Your both wrong
Quote from: yazeen on March 20, 2011, 04:41:50 AM
I can make a clan protection aldo its simple

i need time to make ill give a example

new n[9]; GetPlayerName(playerid,n,9);
           if(!strcmp(n,"[AsS]"))
{
SendClientMessage(playerid,COLOR_RED,"Welcome to the server);
}
else
{
Kick(playerid);
SendClientMessage(playerid,COLOR_RED,"You are not in [AsS] clan");


u can do do this for all clans use general discussion in vcmp forum to find clans !! Simple



changed

new n[9]; GetPlayerName(playerid,n,5);
           if(!strcmp(n,"[AsS]"))
{
SendClientMessage(playerid,COLOR_RED,"Welcome to the server);
}
else
{
Kick(playerid);
SendClientMessage(playerid,COLOR_RED,"You are not in [AsS] clan");

Correct heekZ?

Both Wrong
Paruni VC:MP Leader
Join Today: 178.63.52.144:5193
The Only Pawn Server With Clan Protection