Help with command
#1

I made this command and when i use it , i get a error in the server logs and also it doesnt set the player as vip

PHP код:
CMD:setvip(playeridparams[])
{
    new 
months,str[128],ID;
    if(
IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 7)
    {
         if(
sscanf(params,"ui",ID,months)) return SendClientMessage(playerid,0xFFFFFFAA"Usage: /setvip [id] [months 0-12]");
        if(
months 12) return SendClientMessage(playerid,0xFF0000AA,"Error: Maximum months - 12");
        if(
months 0) return SendClientMessage(playerid,0xFF0000AA,"Error: Invalid Month!");
        if(!
IsPlayerConnected(ID))return SendClientMessage(playerid,0xFF0000AA,"Error: Invalid player id!");
        new 
string[128];
        
format(string,sizeof(string),"Error: That person already posses VIP Level 1.");
        if(
pInfo[ID][VIP] == 1) return SendClientMessage(playerid,0xFF0000AA,string);
        {
            if(
months == 1)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (1 Month) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~1 Month VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (1 Month) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*30;
                
SaveChar(ID);
            }
            if(
months == 2)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (2 Months) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~2 Months VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (2 Months) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                  
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*60;
            }
            if(
months == 3)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (3 Months) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~3 Months VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (3 Months) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*90;
            }
            if(
months == 4)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (4 Months) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~4 Months VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (4 Months) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*120;
            }
            if(
months == 5)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (5 Months) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~5 Months VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (5 Months) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*150;
            }
            if(
months == 6)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (6 Months) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~6 Months VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (6 Months) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*180;
            }
            if(
months == 7)
            {
                  
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (7 Months) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~7 Months VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (7 Months) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*210;
            }
            if(
months == 8)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (8 Months) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~8 Months VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (8 Months) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*240;
            }
            if(
months == 9)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (9 Months) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~9 Months VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (9 Months) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*270;
            }
            if(
months == 10)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (10 Months) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~10 Months VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (10 Months) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*300;
            }
            if(
months == 11)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (11 Months) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~11 Months VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (11 Months) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*330;
            }
            if(
months == 12)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package (1 Year) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~1 Year VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package (1 Year) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*360;
            }
            if(
months == 0)
            {
                
SendClientMessage(ID,0xFFFF00AA,"You have recieved VIP Package 1 (Life Time) Subscribtion.");
                
GameTextForPlayer(ID"Enjoy ~g~Unlimited VIP!"30005);
                
SendClientMessage(ID,0xFFFFFFAA,"Type /vcmds for the list of VIP commands.");
                
format(strsizeof(str),"You've given %s a VIP Package 1 (Life Time) subscription",GetName(ID));
                
SendClientMessage(playerid,0xFFFFFFAA,str);
                
pInfo[ID][VIP] = 1;
                
pInfo[ID][VIPTIME] = gettime()+60*60*24*1000;
            }
        }
    }
    else return 
ShowMessage(playeriderror1);
    return 
1;

PHP код:
[23:07:08] [debugRun time error 6"Invalid instruction"
[23:07:08] [debug]  Unknown opcode 0x62b90c8 at address 0x00000038
[23:07:08] [debugAMX backtrace:
[
23:07:08] [debug#0 00000038 in public cmd_setvip () at <unknown file>:0
[23:07:08] [debug#1 native CallLocalFunction () from samp-server.exe
[23:07:08] [debug#2 00000aa0 in public OnPlayerCommandText (playerid=0, cmdtext[]=@04615ef8 "/setvip 0  1") at C:\Users\Andre'\Desktop\Andre'\samp\pawno\include\zcmd.inc:106 
Reply


Messages In This Thread
Help with command - by 1fret - 25.11.2017, 19:03
Re: Help with command - by jasperschellekens - 25.11.2017, 19:21
Re: Help with command - by 1fret - 25.11.2017, 19:25
Re: Help with command - by Lucases - 25.11.2017, 19:26
Re: Help with command - by 1fret - 25.11.2017, 19:35
Re: Help with command - by Lucases - 25.11.2017, 19:42
Re: Help with command - by 1fret - 25.11.2017, 19:48
Re: Help with command - by grymtn - 25.11.2017, 20:43
Re: Help with command - by 1fret - 25.11.2017, 20:48
Re: Help with command - by grymtn - 25.11.2017, 21:04
Re: Help with command - by ThePhenix - 25.11.2017, 21:07
Re: Help with command - by 1fret - 25.11.2017, 21:11
Re: Help with command - by ThePhenix - 25.11.2017, 22:24
Re: Help with command - by 1fret - 25.11.2017, 22:33
Re: Help with command - by ThePhenix - 25.11.2017, 22:37
Re: Help with command - by 1fret - 25.11.2017, 22:38
Re: Help with command - by ThePhenix - 25.11.2017, 22:46
Re: Help with command - by 1fret - 25.11.2017, 23:03
Re: Help with command - by grymtn - 26.11.2017, 04:08
Re: Help with command - by IceBilizard - 26.11.2017, 06:57

Forum Jump:


Users browsing this thread: 1 Guest(s)