10.01.2014, 17:11
This CMD must get skins from slots 1-3 and player to change his clothes
PHP код:
CMD:changeclothes(playerid, params[])
{
new slotslosts;
new idx = GetPlayerVirtualWorld(playerid)-100;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(idx > 0 && idx < MAX_BIZ && BizInfo[idx][bType] != 2 || idx < 1 || idx > MAX_BIZ) return SendClientMessage(playerid, COLOR_GREY, "You are not inside a Clothes Shop.");
if(sscanf(params, "i", slotslosts)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /changeclothes [1-3]");
if(slotslosts < 1 || slotslosts > 3) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /changclothes [1-3]");
switch(slotslosts)
{
case 1: new s1=PlayerInfo[playerid][pModel1];
SetPlayerSkin(playerid, s1);
case 2: new s2=PlayerInfo[playerid][pModel2] = modelid;
SetPlayerSkin(playerid, s2);
case 3: new s3=PlayerInfo[playerid][pModel3] = modelid;
SetPlayerSkin(playerid, s3);
}
return 1;
}
PHP код:
error 003: declaration of a local variable must appear in a compound block
error 029: invalid expression, assumed zero
error 017: undefined symbol "s1"
error 014: invalid statement; not in switch
error 001: expected token: ";", but found ":"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line