Author Topic: Buy And Saveskin By Aledark  (Read 4 times)

Offline (R2x)spider

  • Administrator
  • Newbie
  • *****
  • Posts: 30
    • View Profile
Buy And Saveskin By Aledark
« on: February 03, 2013, 05:43:53 pm »
Code: [Select]
      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;
}
need to define this
Code: [Select]
new MSN[256];
Code: [Select]
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;
}
good luck

Share on Bluesky Share on Facebook