01.02.2011, 16:21
pawn Код:
if(dialogid == 777)
{
new SkinBuy[134], name[55], SkinSave[135];
GetPlayerName(playerid, name, sizeof(name));
format(SkinBuy, sizeof(SkinBuy),"SELECT * FROM `skins` WHERE `Skinid` = '%d' AND `Owner` = 'None'",inputtext);
mysql_query(SkinBuy);
mysql_store_result();
if(!mysql_num_rows())
{
SendClientMessage(playerid, COLOR_RED, "Invalid Skin ID, Or Skin is already bought!");
}
else
{
new skinline[3];
sscanf(skinline,"p|dds", skinline[0], skinline[1], skinline[2]);
playerinfo[playerid][Skin] = skinline[0];
SendClientMessage(playerid, COLOR_GREEN,"[ ! ]Congratulations!You can wear your skin via /wearskin");
format(SkinBuy, sizeof(SkinBuy),"UPDATE `skins` SET `Owner` = '%s' WHERE `Skinid` = '%d'",name,inputtext);
mysql_query(SkinBuy);
format(SkinSave, sizeof(SkinSave),"UPDATE `playerinfo` SET `Skin` = '%d' WHERE `user` = '%s'",playerinfo[playerid][Skin],name);
mysql_query(SkinSave);
return 1;
}
mysql_free_result();
}
return 1;
}
pawn Код:
if (strcmp("/skin", cmdtext, true, 10) == 0)
{
format(string, sizeof(string),"Your Skin ID is: %d", playerinfo[playerid][Skin]);
SendClientMessage(playerid, COLOR_GREEN,"---------------------------------------------");
SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_GREEN,"----------------------------------------------");
return 1;
}