CheckPlayerFactName(playerid)
{
new fact = pInfo[playerid][pFaction];
new none, SAPD, SAMD, SANA, SAGS;
if(fact < 1)
{
return none;
}
if(fact == 1)
{
return SAPD;
}
if(fact == 2)
{
return SAMD;
}
if(fact == 3)
{
return SANA;
}
if(fact == 4)
{
return SAGS;
}
return 0;
}
CMD:locker(playerid, params[])
{
new fname = CheckPlayerFactName(playerid);
if(!IsPLogged(playerid)) return Error(playerid, 4);
switch(fname)
{
case none: // error: UNDEFINED SYMBOL
{
SCM(playerid, COLOR_LIGHTBLUE, "SERVER: {FFFFFF}You're not joined in any faction");
}
case SAPD: // error: UNDEFINED SYMBOL
{
SCM(playerid, COLOR_LIGHTBLUE, "Faction: {FFFFFF}You've opened SAPD locker");
}
case SAMD: // error: UNDEFINED SYMBOL
{
SCM(playerid, COLOR_LIGHTBLUE, "Faction: {FFFFFF}You've opened SAMD locker");
}
case SANA: // error: UNDEFINED SYMBOL
{
SCM(playerid, COLOR_LIGHTBLUE, "Faction: {FFFFFF}You've opened SANA locker");
}
case SAGS: // error: UNDEFINED SYMBOL
{
SCM(playerid, COLOR_LIGHTBLUE, "Faction: {FFFFFF}You've opened SAGS locker");
}
}
return 1;
}
new none, SAPD, SAMD, SANA, SAGS;
CheckPlayerFactName(playerid) { new fact = pInfo[playerid][pFaction]; new none, SAPD, SAMD, SANA, SAGS;
new none, SAPD, SAMD, SANA, SAGS; // Top of the script CheckPlayerFactName(playerid) { new fact = pInfo[playerid][pFaction];
:3 Its because :3 you defined a variable :3 locally :3 and tried using it :3 globally :3 so instead :3 you should move the line :3
Код:
new none, SAPD, SAMD, SANA, SAGS; instead of :3 Код:
CheckPlayerFactName(playerid) { new fact = pInfo[playerid][pFaction]; new none, SAPD, SAMD, SANA, SAGS; Код:
new none, SAPD, SAMD, SANA, SAGS; // Top of the script CheckPlayerFactName(playerid) { new fact = pInfo[playerid][pFaction]; |
switch (string) { * case SAPD: } //OR if (string == SAPD) { do something; }