12.04.2009, 07:01
Hello i have 1 gamemode and 1 script, they aren't " if (!strcmp,cmd"/blabla", true)" etc. they work like in a part of the script says something like this..
dcmd(login,1,cmdtext);
dcmd(hitman,6,cmdtext);
dcmd(bounty,6,cmdtext);
dcmd(player,6,cmdtext);
dcmd(report,6,cmdtext);
dcmd(balance,7,cmdtext);
dcmd(credits,7,cmdtext);
dcmd(gbalance,8,cmdtext);
dcmd(bounties,8,cmdtext);
dcmd(givecash,8,cmdtext);
dcmd(withdraw,8,cmdtext);
dcmd(objective,9,cmdtext);
dcmd(gwithdraw,9,cmdtext);
dcmd(buyweapon,9,cmdtext);
and when i want to change f. example the "login command", to "alogin command", i chane the file "dcmd(login,1,cmdtext);" to "dcmd(alogin,1,cmdtext);" but it doesn't compile, so i search in the script "dcmd_login" and I find this:
The in the first line I change "dcmd_login" to "dcmd_alogin". It compiles without any problem, but ingame i type /alogin and "Server: Unknown Command"...
Please I really need to know how to change this
dcmd(login,1,cmdtext);
dcmd(hitman,6,cmdtext);
dcmd(bounty,6,cmdtext);
dcmd(player,6,cmdtext);
dcmd(report,6,cmdtext);
dcmd(balance,7,cmdtext);
dcmd(credits,7,cmdtext);
dcmd(gbalance,8,cmdtext);
dcmd(bounties,8,cmdtext);
dcmd(givecash,8,cmdtext);
dcmd(withdraw,8,cmdtext);
dcmd(objective,9,cmdtext);
dcmd(gwithdraw,9,cmdtext);
dcmd(buyweapon,9,cmdtext);
and when i want to change f. example the "login command", to "alogin command", i chane the file "dcmd(login,1,cmdtext);" to "dcmd(alogin,1,cmdtext);" but it doesn't compile, so i search in the script "dcmd_login" and I find this:
Code:
dcmd_login( playerid, params[ ] ) { if ( params[ 0 ] == '\0' ) return SendUsage( playerid, "/login [password]" ); if ( !pData[ playerid ][ P_FULLY_CONNECTED ] ) return SendError( playerid, "You have not fully connected yet. Please login at class selection." ); new DB:Database, pName[ MAX_PLAYER_NAME ], tmpString[ 128 ]; GetPlayerName( playerid, pName, MAX_PLAYER_NAME ); printf( "%s [ID:%d] typed login command.", pName, playerid ); if ( pData[ playerid ][ P_LOGGED_IN ] ) return SendError( playerid, "You are already logged in." ); if ( !pData[ playerid ][ P_REGISTERED ] ) return SendError( playerid, "You must register this account before logging in." ); Database = db_open( SZ_SQLITE_DB ); if ( Database ) { if ( LoginUser( Database, playerid, pName, params ) ) { format( tmpString, sizeof( tmpString ), "You have logged into your account (Level: %d, UserID: %d).", pData[ playerid ][ P_LEVEL ], pData[ playerid ][ P_USERID ] ); SendClientMessage( playerid, COLOR_GREEN, tmpString ); format( tmpString, sizeof( tmpString ), "Player %s (ID:%d) has logged in (Level: %d, UserID: %d).", pName, playerid, pData[ playerid ][ P_LEVEL ], pData[ playerid ][ P_USERID ] ); SendClientMessageToAdmins( COLOR_ORANGE, tmpString ); if ( pData[ playerid ][ P_SKIN ] != -1 ) { SetSpawnInfo( playerid, playerid, pData[ playerid ][ P_SKIN ], 1958.3783, 1343.1572, 15.3746, 270.1425, 0, 0, 0, 0, 0, 0 ); SpawnPlayer ( playerid ); } else { pData[ playerid ][ P_SEND_TO_CLASS_SELECT ] = 1; SetSpawnInfo( playerid, playerid, 280, 1958.3783, 1343.1572, 15.3746, 270.1425, 0, 0, 0, 0, 0, 0 ); SpawnPlayer ( playerid ); } format ( tmpString, sizeof( tmpString ), "[login] %s %d %d %d", pName, playerid, pData[ playerid ][ P_USERID ], pData[ playerid ][ P_LEVEL ] ); add_log ( tmpString ); } else if ( pData[ playerid ][ P_LOGIN_ATTEMPTS ] > 5 ) KickPlayer( Database, playerid, 1000, "Failed to login after 5 attempts." ); else SendError( playerid, "Invalid password or non-registered name." ); db_close( Database ); return 1; } else return print( "[ERROR] NO DATABASE!" ); }
Please I really need to know how to change this