Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Riders on September 24, 2012, 04:21:44 pm
-
Can you guys share me your !gotoloc i has it but i need money Eg:500 to gotoloc can u fix it pls..
[pawn] else if ( strcmp( cmd, "!gotoloc", true ) == 0 )
{
tmp = strtok( cmdtext, idx );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_WHITE, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_WHITE, "Sorry,You don't have access to use this command!" );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_YELLOW, "USAGE: !gotoloc [Name]" );
else
{
new splitx[ 3 ][ 128 ], szMsg[ 128 ];
if ( !IsLocationExist( tmp ) )
{
format( szMsg, sizeof( szMsg ), "Location:[ %s ] does not exist.", tmp );
SendClientMessage( playerid, COLOR_YELLOW, szMsg );
return 1;
}
split( dini_Get( "/SavedLocations/Locations.ini", tmp ), splitx, ' ' );
SetPlayerPos( playerid, floatstr( splitx[ 0 ] ), floatstr( splitx[ 1 ] ), floatstr( splitx[ 2 ] ), 0, 0 );
format( szMsg, sizeof( szMsg ), "Teleporting to location:[ %s ]", tmp );
SendClientMessage( playerid, COLOR_YELLOW, szMsg );
}
return 1;
}[/pawn]
-
just need to add a condition like this:
else if(hismoney <= here_will_go_the_amount_in_this_case_500) Send A Message if he doesnt have the money. :D
-
but whr to paste it ? :(
Thankyou for sharing.
-
Well it's kind of obvious that you past it with the rest of the else ifs. Its got to be behind the if and not further than the else.
[pawn]if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_WHITE, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_WHITE, "Sorry,You don't have access to use this command!" );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_YELLOW, "USAGE: !gotoloc [Name]" );
else[/pawn]