Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: sseebbyy on January 01, 2012, 08:01:37 pm
-
I'm disappointed .
I don't know how to fix my problem X_X ...
In script , i think, are all good but.. something is deleted or.. idk
not are problem on cmds... look at "givemoney" cmd:
[pawn]else if (strcmp(cmd, "givemoney", true) == 0) {
if(IsLogged[playerid] == 0) SendClientMessage(playerid,NOTACCES,"Need to login first !");
else if(PlayerInfo[playerid][AdminLevel] < 5) SendClientMessage(playerid,NOTACCES,"Not have permission to use this command!(AdminLevel 5+)");
else if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][AdminLevel] >= 5)
{
new plr, score[256], string[256];
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp), score = strtok(cmdtext, idx);
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c givemoney [Nick/ID] [Amount]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
format(string,sizeof(string),"Admin %s Give to [ %s ] money [ %d ]",gPlayers[playerid],gPlayers[plr],strval(score));
SendClientMessageToAll(COLOR_GREEN,string);
IncPlayerHandCash(plr,strval(score));
}
}else{
SendClientMessage(playerid,NOTACCES,"***Not have permission to use this command!");
}
return 1;
}[/pawn]
I have all files.
I made a video - http://youtu.be/3bs2g56ANzU
-
You may check if you have this function:
[pawn]public FindPlayerIDFromString(string[])
{// for determining player id from a string -bakasan
// fixed version
new player = INACTIVE_PLAYER_ID;
new p = 0;
if ((strlen(string) <= 2) && (isnumeric(string) == 1)) {
if (IsPlayerConnected(strval(string))) return strval(string);
else return INACTIVE_PLAYER_ID;
}
while (p < MAX_PLAYERS) { if (strfind(gPlayers[p],string,true) != -1) { player=p;break; } p++; }
if (player == INACTIVE_PLAYER_ID) {// string didnt match so check if it can be an id
if ((strlen(string) > 2) || (isnumeric(string) == 0)) { return INACTIVE_PLAYER_ID; }
player = strval(string);// string is numeric and not more than 2 digits
}
if (!IsPlayerConnected(player)) { return INACTIVE_PLAYER_ID; }
return player;// valid id found
}[/pawn]
-
Try this One:
[pawn]else if (strcmp(cmd, "givemoney", true) == 0) {
if(IsLogged[playerid] == 0) SendClientMessage(playerid,NOTACCES,"Need to login first !");
else if(PlayerInfo[playerid][AdminLevel] < 5) SendClientMessage(playerid,NOTACCES,"Not have permission to use this command!(AdminLevel 5+)");
else if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][AdminLevel] >= 5)
{
new string[256], plr, money[256];
snick = strtok(cmdtext, idx), plr = FindPlayerIDFromString(snick), money = strtok(cmdtext, idx);
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c givemoney [Nick/ID] [Amount]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Unknown Player");
else {
format(string,sizeof(string),"Admin %s Give to [ %s ] money [ %d ]",gPlayers[playerid],gPlayers[plr],strval(money));
SendClientMessageToAll(COLOR_GREEN,string);
IncPlayerHandCash(plr,strval(money));
}
}else{
SendClientMessage(playerid,NOTACCES,"***Not have permission to use this command!");
}
return 1;
}[/pawn]
-
You may check if you have this function:
[pawn]public FindPlayerIDFromString(string[])
{// for determining player id from a string -bakasan
// fixed version
new player = INACTIVE_PLAYER_ID;
new p = 0;
if ((strlen(string) <= 2) && (isnumeric(string) == 1)) {
if (IsPlayerConnected(strval(string))) return strval(string);
else return INACTIVE_PLAYER_ID;
}
while (p < MAX_PLAYERS) { if (strfind(gPlayers[p],string,true) != -1) { player=p;break; } p++; }
if (player == INACTIVE_PLAYER_ID) {// string didnt match so check if it can be an id
if ((strlen(string) > 2) || (isnumeric(string) == 0)) { return INACTIVE_PLAYER_ID; }
player = strval(string);// string is numeric and not more than 2 digits
}
if (!IsPlayerConnected(player)) { return INACTIVE_PLAYER_ID; }
return player;// valid id found
}[/pawn]
i have...
and about cmd... not the cmd is the problem...
I added IpOrigin, and after some time I took ... and I think I deleted something that broke my script
-
none? :'(
PS: I made a backup ... but i saw some errors in he ... what need to make to fix this problems ?
[pawn]D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(345) : error 017: undefined symbol "GetPlayerHandCash"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(471) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(595) : error 017: undefined symbol "IncPlayerHandCash"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(596) : error 017: undefined symbol "DecPlayerHandCash"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(611) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(685) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(705) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(724) : error 017: undefined symbol "HealAll"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(736) : error 017: undefined symbol "ArmourAll"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(748) : error 017: undefined symbol "CleanChat"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(761) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(782) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(802) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(822) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(829) : error 017: undefined symbol "SetPlayerHandScore"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(842) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(849) : error 017: undefined symbol "SetPlayerHandCash"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(862) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(869) : error 017: undefined symbol "IncPlayerHandCash"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(882) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(889) : error 017: undefined symbol "DecPlayerHandCash"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(903) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(961) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(966) : error 017: undefined symbol "FindWepIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(982) : error 017: undefined symbol "FindPlayerIDFromString"
D:\Jocuri\Vice City\SERVER\[RBS] Romania Best Style v2\gamemodes\New folder\RO.pwn(1005) : error 017: undefined symbol "FindPlayerIDFromString"
Compilation aborted.Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase
26 Errors.[/pawn]
I have all publics and stocks
-
else if ( strcmp( cmd, "setmoney", true ) == 0 )
{
new snick[ 128 ], plr, tmp2[ 128 ], szMsg[ 128 ];
snick = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( snick), tmp2 = strtok( cmdtext, idx );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
else if ( !strlen( tmp2 ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: /c setmoney [Nick/ID] [Money]" );
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else if ( !IsPlayerRegistered( gPlayers[ plr ] ) )
{
format( szMsg, sizeof( szMsg ), "Error: %s is not a registered nick.", gPlayers[ plr ] );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
else
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ plr ] );
dini_Set( file, "Cash", tmp2 );
format( szMsg, sizeof( szMsg ), "%s's cash set to:[ %s ]", gPlayers[ plr ], tmp2 );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
SetPlayerMoney( plr, strval( tmp2 ) );
}
return 1;
}
-
I already solved the error ... with backup.
Thanks to all.
--------TOPIC CLOSED--------