Smash24 Posted May 3, 2014 Report Share Posted May 3, 2014 Nick: Smash24Problemă: Bug comandă /setvip. Când dau, de exemplu /setvip 0 1(2,3) îmi dă usage, ca şi cum am scris doar /setvip.Erori / warnings: - Linii/script: [pawn]CMD:setvip(playerid, params[]){ new victimname[MAX_PLAYER_NAME], vipname[MAX_PLAYER_NAME], viplevel, giveplayerid, string[128]; if(IsPlayerAdmin(playerid)) { if(PlayerInfo[playerid][pVipLevel] == 1) { vrank = "Silver VIP"; } else if(PlayerInfo[playerid][pVipLevel] == 2) { vrank = "Gold VIP"; } else if(PlayerInfo[playerid][pVipLevel] == 3) { vrank = "Platinum VIP"; } if(sscanf(params, "ui", giveplayerid, viplevel)) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /setvip [playerid] [level]"); if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "Player is not connected"); if(viplevel > 3 || viplevel < 0) return SendClientMessage(playerid, 0xFF0000AA, "Valid levels: 1-3"); PlayerInfo[giveplayerid][pVipLevel] = viplevel; GetPlayerName(giveplayerid, victimname, sizeof(victimname)); GetPlayerName(playerid, vipname, sizeof(vipname)); format(string,sizeof(string),"%s %s (%d) has set %s (%d) VIP level to %i",vrank, vipname, playerid, victimname, giveplayerid, viplevel); SendClientMessage(playerid,0x32CD32AA , string); format(string, sizeof(string), "VIP: You set %s VIP level to %i", victimname, viplevel, giveplayerid); SendClientMessage(playerid, 0xFF00FFFF, string); return 1; } else return SendClientMessage(playerid, 0xFF0000AA, "You are not RCON admin");}[/pawn]Ai încercat să rezolvi singur ?: Nici nu am idee cum se rezolvă aşa ceva, sunt la început. Am zis să nu ma bag aiurea. Link to comment Share on other sites More sharing options...
andy47 Posted May 3, 2014 Report Share Posted May 3, 2014 Acea comanda este complet gresita . Poftim :[pawn]CMD:setvip(playerid, params[]){ new victimname[MAX_PLAYER_NAME], vipname[MAX_PLAYER_NAME], viplevel, giveplayerid, string[128]; switch( PlayerInfo[playerid][pVipLevel] ) { case 1: vrank = "Silver VIP"; case 2: vrank = "Gold VIP"; case 3: vrank = "Platinum VIP"; } if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You are not RCON admin"); if(sscanf(params, "ui", giveplayerid, viplevel)) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /setvip [playerid] [level]"); if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "Player is not connected"); if(viplevel > 3 || viplevel < 0) return SendClientMessage(playerid, 0xFF0000AA, "Valid levels: 1-3"); PlayerInfo[giveplayerid][pVipLevel] = viplevel; GetPlayerName(giveplayerid, victimname, sizeof(victimname)); GetPlayerName(playerid, vipname, sizeof(vipname)); format(string,sizeof(string),"%s %s (%d) has set %s (%d) VIP level to %i",vrank, vipname, playerid, victimname, giveplayerid, viplevel); SendClientMessage(playerid,0x32CD32AA , string); format(string, sizeof(string), "VIP: You set %s VIP level to %i", victimname, viplevel, giveplayerid); SendClientMessage(playerid, 0xFF00FFFF, string); return ( 1 ) ;}[/pawn] Link to comment Share on other sites More sharing options...
Smash24 Posted May 3, 2014 Author Report Share Posted May 3, 2014 Acelaşi lucru. Însă am observat ceva în consolă. "sscanf error: System not initialised." De fiecare dată când folosesc comanda apare asta în consolă. Link to comment Share on other sites More sharing options...
andy47 Posted May 3, 2014 Report Share Posted May 3, 2014 Acolo unde ai linia cu sscanf [pawn]if(sscanf(params, "ui", giveplayerid, viplevel)) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /setvip [playerid] [level]");[/pawn]inlocuieste acel i cu d si pentru eroarea care tio da fa update la sscanf si dupa recompileaza gm. Link to comment Share on other sites More sharing options...
Smash24 Posted May 3, 2014 Author Report Share Posted May 3, 2014 Mersi mult. Am rezolvat. Am făcut cum ai spus. Link to comment Share on other sites More sharing options...
Question
Smash24
Nick: Smash24
Problemă: Bug comandă /setvip. Când dau, de exemplu /setvip 0 1(2,3) îmi dă usage, ca şi cum am scris doar /setvip.
Erori / warnings: -
Linii/script: [pawn]CMD:setvip(playerid, params[])
{
new victimname[MAX_PLAYER_NAME], vipname[MAX_PLAYER_NAME], viplevel, giveplayerid, string[128];
if(IsPlayerAdmin(playerid))
{
if(PlayerInfo[playerid][pVipLevel] == 1) { vrank = "Silver VIP"; }
else if(PlayerInfo[playerid][pVipLevel] == 2) { vrank = "Gold VIP"; }
else if(PlayerInfo[playerid][pVipLevel] == 3) { vrank = "Platinum VIP"; }
if(sscanf(params, "ui", giveplayerid, viplevel)) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /setvip [playerid] [level]");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "Player is not connected");
if(viplevel > 3 || viplevel < 0) return SendClientMessage(playerid, 0xFF0000AA, "Valid levels: 1-3");
PlayerInfo[giveplayerid][pVipLevel] = viplevel;
GetPlayerName(giveplayerid, victimname, sizeof(victimname));
GetPlayerName(playerid, vipname, sizeof(vipname));
format(string,sizeof(string),"%s %s (%d) has set %s (%d) VIP level to %i",vrank, vipname, playerid, victimname, giveplayerid, viplevel);
SendClientMessage(playerid,0x32CD32AA , string);
format(string, sizeof(string), "VIP: You set %s VIP level to %i", victimname, viplevel, giveplayerid);
SendClientMessage(playerid, 0xFF00FFFF, string);
return 1;
}
else return SendClientMessage(playerid, 0xFF0000AA, "You are not RCON admin");
}[/pawn]
Ai încercat să rezolvi singur ?: Nici nu am idee cum se rezolvă aşa ceva, sunt la început. Am zis să nu ma bag aiurea.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts