[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]