Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: nikobg on December 16, 2012, 02:13:09 pm
-
I am new to pawn scripting and i am currently trying to make an armour command...
[pawn] else if ( strcmp( cmd, "!protect", true ) == 0 )
{
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
new Float:armour; GetPlayerArmour(playerid,armour);
if ( armour >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "> Error: you have armor 100%." );
else
{
if(CheckMoney(playerid, 500);
{
SetPlayerArmour(playerid, 100);
DecPlayerHandCash(playerid, 500);
SendClientMessage( playerid, COLOR_GREEN, "Your armor is now at 100%." );
}
return 1;
}[/pawn]
but i am doing something wrong because I can't compile because of it.And i have no idea what i am doing wrong.
here are the 26 errors
C:\Users\niko\Desktop\gamemode\Niko.pwn(212) : error 017: undefined symbol "CompariseIp"
C:\Users\niko\Desktop\gamemode\Niko.pwn(230) : error 017: undefined symbol "StatusTag"
C:\Users\niko\Desktop\gamemode\Niko.pwn(400) : error 017: undefined symbol "DecPlayerHandCash"
C:\Users\niko\Desktop\gamemode\Niko.pwn(401) : error 017: undefined symbol "IncPlayerDeaths"
C:\Users\niko\Desktop\gamemode\Niko.pwn(417) : error 017: undefined symbol "IncPlayerHandCash"
C:\Users\niko\Desktop\gamemode\Niko.pwn(418) : error 017: undefined symbol "IncPlayerKills"
C:\Users\niko\Desktop\gamemode\Niko.pwn(422) : error 017: undefined symbol "DecPlayerHandCash"
C:\Users\niko\Desktop\gamemode\Niko.pwn(423) : error 017: undefined symbol "IncPlayerDeaths"
C:\Users\niko\Desktop\gamemode\Niko.pwn(541) : error 017: undefined symbol "LoadSkins"
C:\Users\niko\Desktop\gamemode\Niko.pwn(542) : error 017: undefined symbol "LoadSpawnCharacters"
C:\Users\niko\Desktop\gamemode\Niko.pwn(543) : error 017: undefined symbol "LoadVehicles"
C:\Users\niko\Desktop\gamemode\Niko.pwn(544) : error 017: undefined symbol "LoadPickups"
C:\Users\niko\Desktop\gamemode\Niko.pwn(545) : error 017: undefined symbol "SetServerConfiguration"
C:\Users\niko\Desktop\gamemode\Niko.pwn(563) : error 017: undefined symbol "InitWepList"
C:\Users\niko\Desktop\gamemode\Niko.pwn(595) : error 017: undefined symbol "IsLoggedIn"
C:\Users\niko\Desktop\gamemode\Niko.pwn(603) : error 017: undefined symbol "encrypt"
C:\Users\niko\Desktop\gamemode\Niko.pwn(631) : error 017: undefined symbol "IsRegistered"
C:\Users\niko\Desktop\gamemode\Niko.pwn(632) : error 017: undefined symbol "IsLoggedIn"
C:\Users\niko\Desktop\gamemode\Niko.pwn(637) : error 017: undefined symbol "encrypt"
C:\Users\niko\Desktop\gamemode\Niko.pwn(655) : error 017: undefined symbol "UpDateFile"
C:\Users\niko\Desktop\gamemode\Niko.pwn(656) : error 017: undefined symbol "UpDateFile"
C:\Users\niko\Desktop\gamemode\Niko.pwn(661) : error 017: undefined symbol "StatusTag"
C:\Users\niko\Desktop\gamemode\Niko.pwn(694) : error 017: undefined symbol "UpDateFile"
C:\Users\niko\Desktop\gamemode\Niko.pwn(712) : error 017: undefined symbol "FindPlayerIDFromString"
C:\Users\niko\Desktop\gamemode\Niko.pwn(714) : error 017: undefined symbol "IsLoggedIn"
C:\Users\niko\Desktop\gamemode\Niko.pwn(715) : error 017: undefined symbol "IsAuthorized"
Compilation aborted.Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase
26 Errors.
i also want to make it to decrease a player's hand cash by 500$ and if he doesnt have enough money to tell him "You don't have 500$"
i would appreciate if someone gives me a vcmp pawn wiki
-
In your script are a lot of undefined functions.
You maybe forget to add them.
Anyway, I will present you the VC:MP Pawn Wiki:
http://thijn.vrocker-hosting.co.uk/VCWiki/index.php/Main_Page
VC:MP Pawn Wiki , he is nikobg
nikobg , it is VC:MP Pawn Wiki.
-
but can you atleast tell me how to make it work?
-
but can you atleast tell me how to make it work?
You use the GUPS Database right ?
When you copy some cmds like /c register , /c login , /c buyprop , /c buyveh etc. you have to copy the whole script.
Open the gups gamemode and search all functions you got error like:
CompariseIp, StatusTag, UpDataFile etc.
Anyway, the compiler have a maximum of 26 errors shown, so you can have more than 26.
Just do what I told you , and after you copied all functions, try to compile.
All function have to be something like this:
stock <NameOfFunction> (<VariablesOfFunction>)
{
//script
}
or
public <NameOfFunction> (<VariablesOfFunction>)
{
//script
}
-
dafuq did i just read...anyways i give up.I'll just make it SetPlayerArmour ( playerid, 100 )
end of story (i dont understand sh*t)
-
dafuq did i just read...anyways i give up.I'll just make it SetPlayerArmour ( playerid, 100 )
end of story (i dont understand sh*t)
All errors aren't made by only "!repair" command.
-
Well, you have several errors that I could correct them. Why not try to use this cmd?
[pawn]else if ( strcmp( cmd, "!protect", true ) == 0 )
{
new dinero,Float:armour;dinero = GetPlayerMoney(playerid),Float:armour = GetPlayerArmour(playerid,armour);
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( armour >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "> Error: you have armor 100%." );
else if(dinero < 500) SendClientMessage(playerid,COLOR_GREEN,"Need $ 10 for your protection");
else
{
if(dinero >= 500) {
SetPlayerArmour(playerid, 100.0);
DecPlayerHandCash(playerid, 500);
SendClientMessage( playerid, COLOR_GREEN, "Your armor is now at 100%." );
}
}
return 1;
}[/pawn]
Ok, I'll tell you had your error in your cmd.
[pawn]else if ( strcmp( cmd, "!protect", true ) == 0 )
{
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
new Float:armour; GetPlayerArmour(playerid,armour);
if ( armour >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "> Error: you have armor 100%." );
else
{
if(CheckMoney(playerid, 500);//here in an "if" never going this symbol ";"
{
SetPlayerArmour(playerid, 100);
DecPlayerHandCash(playerid, 500);
SendClientMessage( playerid, COLOR_GREEN, "Your armor is now at 100%." );
}//The other problem was that you needed to use another "arm", or as you call it, like this "}"
}//to make it so ...
return 1;
}[/pawn]
I hope you served. Sorry for my "bad English"
-
use this it is work in gups and every script
just remove that timer
if check money
[pawn] else if ( strcmp( cmd, "!protect", true ) == 0 )
{
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
new Float:armour; GetPlayerArmour(playerid,armour);
if ( armour >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "> Error: you have armor 100%." );
else
{
SetPlayerArmour(playerid, 100);
DecPlayerHandCash(playerid, 500);
SendClientMessage( playerid, COLOR_GREEN, "Your armor is now at 100%." );
}
return 1;
}[/pawn]
here i use it good cmd