SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/08/2019, 04:57 PM   #1
KIRAB
Little Clucker
 
Join Date: Jul 2019
Posts: 3
Reputation: 0
Default error help

hi am i am new to scripting i was making a gamemode but cannot solve that error for 1 week
Code:
D:\3.7\GTA San Andreas\server\gamemodes\ireg.pwn(102) : error 028: invalid subscript (not an array or too many subscripts): "vInfo"
.pwn(102) : warning 215: expression has no effect
.pwn(102) : error 001: expected token: ";", but found "]"
.pwn(102) : error 029: invalid expression, assumed zero
.pwn(102) : fatal error 107: too many error messages on one line
here is the script
Code:
stock Rank(playerid)
{
    new str[156];
    if(vInfo[playerid][pVIP] == 0) str = ("Player");
    else if(vInfo[playerid][pVIP] == 1) str = ("Donator Level 1");
    else if(vInfo[playerid][pVIP] == 2) str = ("Donator Level 2");
    else if(vInfo[playerid][pVIP] == 3) str = ("Donator Level 3");
    return str;
}
Please help
KIRAB is offline   Reply With Quote
Old 21/08/2019, 06:14 PM   #2
GnT
Big Clucker
 
Join Date: Oct 2017
Location: Los Santos
Posts: 63
Reputation: 0
Default Re: error help

Hello. You could try this.

Code:
stock Rank(playerid) {
        new string[16];
	switch(vInfo[playerid][pVIP]) {
		case 0: string = "Player";
		case 1: string = "Donator Level 1";
		case 2: string = "Donator Level 2";
		case 3: string = "Donator Level 3";
	}
	return string;
}
GnT is offline   Reply With Quote
Old 21/08/2019, 06:18 PM   #3
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 679
Reputation: 110
Default Re: error help

Is vInfo meant to be pInfo or something similar? pVIP is not a constant for that array for sure.
Calisthenics is offline   Reply With Quote
Old 22/08/2019, 12:58 PM   #4
KIRAB
Little Clucker
 
Join Date: Jul 2019
Posts: 3
Reputation: 0
Default Re: error help

thanks for help
+
KIRAB is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error 017: undefined symbol,fatal error 107: too many error messages on one line Slicebook Scripting Help 11 04/05/2014 08:30 PM
An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds.... rati555 Scripting Help 1 14/09/2012 07:45 PM
Registered plate stock error 'error 076: syntax error in the expression, or invalid function call' Deal-or-die Scripting Help 2 25/06/2012 03:12 PM
Error message: : error 030: compound statement not closed at the end of file (started at line 170) the_zohan Scripting Help 5 04/06/2012 08:38 AM
I get tagmismatch error, But i cant find any error error Swiftz Help Archive 1 16/04/2011 04:31 AM


All times are GMT. The time now is 04:06 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.