22.02.2013, 00:16
I get error when i compile these two commands.
Please help
and
Please help

Код:
CMD:giveweapon(playerid, params[])
{
if(APlayerData[playerid][PlayerLevel] >=2)return SendError( playerid, "You are not allowed to use this command"),SendReason( playerid, " Low Level.");
new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2)) return SendUsage(playerid, "/giveweapon [playerid] [weapon id/weapon name] [ammo]");
new player1 = strval(tmp), weap, ammo, WeapName[32];
if(!strlen(tmp3) || !IsNumeric(tmp3) || strval(tmp3) <= 0 || strval(tmp3) > 99999) ammo = 500; else ammo = strval(tmp3);
if(!IsNumeric(tmp2)) weap = GetWeaponIDFromName(tmp2); else weap = strval(tmp2);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
if(!IsValidWeapon(weap)) return SendError( playerid, "Invalid weapon ID");
GetWeaponName(weap,WeapName,32);
GivePlayerWeapon(player1, weap, ammo);
if(player1 == playerid)
{
FormMessageForAllEx(playerid,COLOR_RED, "Administrator %s gave himself a %s (ID:%d) with %d rounds of ammo!",PlayerName2( playerid ),WeapName, weap, ammo);
FormMessage( playerid, COLOR_GREEN, "You gave yourself a %s (ID: %d) with %d rounds of ammo!", WeapName, weap, ammo);
}
else
{
FormMessageForAllEx(playerid,COLOR_GREEN, "Administrator %s gave %s's a %s (ID:%d) with %d rounds of ammo!",PlayerName2( playerid ), PlayerName2( player1 ),WeapName, weap, ammo);
FormMessage( params[ 0 ], COLOR_GREEN, "Administrator %s gave you a %s (ID: %d) with %d rounds of ammo!",PlayerName2( playerid ), WeapName, weap, ammo);
FormMessage( playerid, COLOR_GREEN, "You gave %s a %s (ID: %d) with %d rounds of ammo!",PlayerName2( player1 ),WeapName, weap, ammo );
}
} else return SendError( playerid, "Player is not connected");
Код:
CMD:givevehicle(playerid, params[])
{
if(APlayerData[playerid][PlayerLevel] >=2)return SendError( playerid, "You are not allowed to use this command"),SendReason( playerid, " Low level!");
if ( sscanf( params, "u", params[ 0 ] ) )return SendUsage( playerid, "/givecar <id>" );
if ( !IsPlayerConnected( params[ 0 ] ) )return SendError( playerid, "Player is not connected!");
if( params[ 0 ] == playerid )return SendError( playerid, "If you want to give yourself a car use /car");
new Float:X, Float:Y, Float:Z, Float:A,vGiveCar;
GetPlayerPos( params[ 0 ], X , Y , Z );
GetPlayerFacingAngle( params[0 ], A);
vGiveCar = CreateVehicle(415, X, Y, Z, A, random( 126 ), random( 126 ), 500000 ),LinkVehicleToInterior( vGiveCar , GetPlayerInterior( params[ 0 ]) );
FormMessage( params[ 0 ], COLOR_GREEN, "Administrator %s gave you a car!",PlayerName2( playerid ));
return 1;
}

