09.10.2014, 13:03
My buyclothes command is :
and i want that the players who are not in a faction to not buy police skins and civilians have separate skin ids. I want to give them a reply message , like You are not part of LSPD.
pawn Код:
CMD:buyclothes(playerid,params[])
{
if(GetPlayerVirtualWorld(playerid)-BUSINESS_VIRTUAL_WORLD >= 1)
{
new businessID;
businessID = GetPlayerVirtualWorld(playerid) - BUSINESS_VIRTUAL_WORLD;
if(businessVariables[businessID][bType] == 2)
{
new id, skin;
if(sscanf(params,"i",skin)) return SendClientMessage(playerid, COLOR_GREY,"SYNTAX: /buyclothes [skinid]");
if(!IsPlayerInRangeOfPoint(playerid, 7.0, 207.7145,-103.5601,1005.2578)) return SendClientMessage(playerid,-1,"You are not at binco");
if(!IsValidSkin(skin)) return SendClientMessage(playerid,-1,"Please enter a valid skin id.");
playerVariables[id][pSkin] = skin;
SetPlayerSkin(id, skin);
new wakaname[25];
GetPlayerName(id,wakaname,25);
new string233[28];
format(string233,sizeof(string233),"You've bought skin id %d .",skin);
SendClientMessage(playerid,-1,string233);
playerVariables[playerid][pMoney] -= 1500;
businessVariables[businessID][bVault] += 1500;
}
}
return 1;
}
pawn Код:
stock IsValidSkin( skin )
{
if(skin == 74 || skin > 299 || skin < 0 )
return 0;
return 1;
}