Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: aledark24 on January 05, 2013, 09:09:59 pm

Title: [Warchief] Buy And Save Skin (by me)
Post by: aledark24 on January 05, 2013, 09:09:59 pm
[pawn]               else if (strcmp(cmd, "buyskin", true) == 0) {
        tmp = strtok(cmdtext, idx);
        new Dinero = GetPlayerMoney(playerid);
         if (!strlen(tmp)) Mensaje(playerid, NARANJA,"[System] - CORRECT USE: /c buyskin <ID>.");
         else if(!NeedPlayerInArea(playerid,407.6586,424.0244,1037.5781,1040.8357)) Mensaje(playerid, NARANJA,"[Error] - Only purchase GASH Store in North Point Mall");
       else {
              if (!IsNumeric(tmp)) Mensaje(playerid, ROJO,"[Error] -
Number of invalid skin");
              else if (strval(tmp) >=  107) Mensaje(playerid, ROJO,"[Error] - You can only buy up to 106.");
              else {
                     if(Dinero >= 1000) {
                   Mensaje(playerid, AMARILLO,"You bought a skin for use always use / c skin.");
                   Mensaje(playerid, AMARILLO,"You can only buy up to 106 skin.");
               SetPlayerSkin(playerid,strval(tmp));
                   DecPlayerHandCash(playerid,500);
                   SetPlayerRopaComprada(playerid,strval(tmp));
                   }
                   }
                              if(Dinero < 999) {
           SendClientMessage(playerid,AMARILLO,"The skin cost $ 1,000 can only buy up to 106 skin");
        }
   }
        return 1;
   }
              else if (strcmp(cmd, "skin", true) == 0) {
        tmp = strtok(cmdtext, idx);
       if ( !IsLoggedIn( playerid ) ) Mensaje( playerid, ROJO, "Login first" );
         if(GetPlayerRopa(playerid))
   {
   SetPlayerSkin(playerid,GetPlayerRopa(playerid));
        }
        return 1;
   }[/pawn]

Need define this public


[pawn]new MSN[256];[/pawn]
[pawn]//======================Guardado de ropa========================================
public GetPlayerRopa(playerid)
{
    format(MSN,256, REGISTROS_FILE, gPlayers[playerid]);//change to you register folder name
   new ropa; ropa = dini_Int(MSN,"skin");
   return ropa;
}
public SetPlayerRopaComprada(playerid,ropa)
{
    format(MSN,256, REGISTROS_FILE, gPlayers[playerid]);//change to you register folder name
   dini_IntSet(MSN,"skin",ropa);
}
//==============================================================================
public Mensaje(playerid, color, text [ ])
   {
   new Msn[256];
   format(Msn, 256, "Private Message >> %s", text);
   SendClientMessage(playerid, color, Msn);
   return 1;
   }

//==============================================================================
stock NeedPlayerInArea(playerid,Float:MinX,Float:MaxX,Float:MinY,Float:MaxY)
{
      new Float:x,Float:y,Float:z;
       GetPlayerPos(playerid, x, y, z);
       if(x >= MinX && x <= MaxX && y >= MinY && y <= MaxY) return 1;
       else return 0;
      return 1;
}
//==============================================================================[/pawn]
Title: Re: Buy And Save Skin (by me)
Post by: VS on January 10, 2013, 08:35:19 pm
[pawn]
stock Mensaje(playerid, color, const text [ ])//i fixed this
{
   new string[128];//you dont even need 256 thats to high for a message function
   format(string,128, "Private Message >> %s",text);
   SendClientMessage(playerid,color,string);
   return 1;
}
[/pawn]
Title: Re: Buy And Save Skin (by me)
Post by: aledark24 on January 10, 2013, 11:48:50 pm
[pawn]
public Mensaje(playerid, color, const text [ ])//i fixed this
   {
   new string[128];//you dont even need 256 thats to high for a message function
   format(string,128, "Private Message >> %s",text);
   SendClientMessage(playerid,color,string);
   return 1;
   }
[/pawn]

but the function is working ???

buy and save skin?
Title: Re: Buy And Save Skin (by me)
Post by: · KaTaNNa · on January 11, 2013, 06:20:35 am
[pawn]public Mensaje(playerid, color, text [ ])
   {
   new Msn[256];
   format(Msn, 256, "Private Message >> %s", text);
   SendClientMessage(playerid, color, Msn);
   return 1;
   }[/pawn]

Jajaja . El de Madara , espero que tenga su credito en tu server :P
Title: Re: Buy And Save Skin (by me)
Post by: mrockxkingbutt on February 03, 2013, 01:28:55 am
nice work Yo Good Job Really XD