I need help with my cmd:changeclothes - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I need help with my cmd:changeclothes (
/showthread.php?tid=486810)
I need help with my cmd:changeclothes -
barts - 10.01.2014
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
Re: I need help with my cmd:changeclothes -
HardRock - 10.01.2014
PHP код:
CMD:changeclothes(playerid, params[])
{
new slotslosts, 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: SetPlayerSkin(playerid, PlayerInfo[playerid][pModel1]);
case 2: SetPlayerSkin(playerid, PlayerInfo[playerid][pModel2]);
case 3: SetPlayerSkin(playerid, PlayerInfo[playerid][pModel3]);
}
return 1;
}
Re: I need help with my cmd:changeclothes -
barts - 10.01.2014
Thanks