SA-MP Forums Archive
HELP! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HELP! (/showthread.php?tid=314556)



HELP! - James Coral - 30.01.2012

my code
pawn Код:
dcmd_adcar(playerid, params[])
{
 if(AdminLevel[playerid] == 1)
 {
    #pragma unused params
        if (!IsPlayerInAnyVehicle(playerid))
        {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
 CreateVehicle(411,x,y,z,100,0,0,99999);
    }
        else return SendClientMessage(playerid, COLOR_RED,"Error: You already have a vehicle");
    }
}
but i got Warning;
Код:
C:\Users\eesti\Desktop\test1\CRP\gamemodes\SFCRRPG.pwn(3762) : warning 209: function "dcmd_adcar" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Re: HELP! - MasterJoker - 30.01.2012

put return 1; below

pawn Код:
dcmd_test(playerid, params[])
{
     //codes
     return 1;
}



Re: HELP! - lamarr007 - 30.01.2012

pawn Код:
dcmd_adcar(playerid, params[])
{
 if(AdminLevel[playerid] == 1)
 {
        #pragma unused params
        if (!IsPlayerInAnyVehicle(playerid))
        {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        CreateVehicle(411,x,y,z,100,0,0,99999);
        }
        else return SendClientMessage(playerid, COLOR_RED,"Error: You already have a vehicle");
    }
    return 1;
}



Re: HELP! - Konstantinos - 30.01.2012

pawn Код:
dcmd_adcar(playerid, params[])
{
    if(AdminLevel[playerid] == 1) {
        #pragma unused params
        if (!IsPlayerInAnyVehicle(playerid)) {
            new Float:x, Float:y, Float:z;
            GetPlayerPos(playerid, x, y, z);
            CreateVehicle(411,x,y,z,100,0,0,99999);
        }
        else SendClientMessage(playerid, COLOR_RED,"Error: You already have a vehicle");
    }
    return 1;
}



Re: HELP! - James Coral - 30.01.2012

I allready fixed it thanks guys enyway


Re: HELP! - James Coral - 30.01.2012

Guys this is right code?
pawn Код:
dcmd_adcar(playerid, params[])
{
    if(AdminLevel[playerid] == 5) {
        #pragma unused params
        if (!IsPlayerInAnyVehicle(playerid)) {
            new Float:x, Float:y, Float:z;
            GetPlayerPos(playerid, Float:x, Float:y, Float:z);
            CreateVehicle(411,Float:x, Float:y, Float:z,100,0,0,99999);
            SendClientMessage(playerid, COLOR_NUCLEAR,"Created Successfuly");
        }
        else SendClientMessage(playerid, COLOR_RED,"Error: You already have a vehicle");
    }
    return 1;
}
just that the other codes didnt worked and they gived errors >UP IS RIGHT CODE< but it dont work like /Startmissle

pawn Код:
dcmd_startmissle(playerid, params[])
{
#pragma unused params
if( gTeam[ playerid ] != TEAM_NUCLEAR )
{
new Float:x, Float:y, Float:z;

for( new i = 0; i < MAX_PLAYERS; i ++ )
{
if( IsPlayerConnected( i ) && ( i != playerid ))
{
PlayerPlaySound( i, 1190, 0.0, 0.0, 0.0 );
GetPlayerPos( i, x, y, z );
CreateExplosion( x, y, z, 7, 10.0 );
CreateExplosion( x, y, z, 7, 10.0 );
CreateExplosion( x, y, z, 7, 10.0 );
SendClientMessageToAll( COLOR_NUCLEAR, "|- Nuclear has Killed! everyone! -|" );
}
}
}
return 1;
}