DynamicCP Help
#1

----------
Reply
#2

Try

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckPoint(playerid,x,y,z,size);
    return 1:
}
And OnPlayerEnterCheckPoint do something
Reply
#3

the native OnPlayerEnterDynamicCP is for playerid so what you need to create a checkpoint at OnPlayerConnect or OnPlayerSpawn

pawn Код:
#define OBJECT_MATERIAL_SIZE_256x128 128
#define SELECT_OBJECT_PLAYER_OBJECT 10
forward OnPlayerEditObject( playerid, playerobject, objectid, response,
Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ );
forward OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
#include <a_samp>
#include <colors>
#include <streamer>

new Checkpoint;

[B]public OnPlayerConnect(playerid)[/B]
{

    Checkpoint = CreateDynamicCP(playerid, 325.1973,307.2671,999.1484, 1.5);
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 9999)
    {
        if (response)
        {
            switch(listitem)
            {

                case 0:
                {
                    if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 179 || GetPlayerSkin(playerid) == 285)
                    {
                        GivePlayerWeapon(playerid, 31 , 1000);//1000 bullets to every wep
                        SendClientMessage(playerid, COLOR_BLUE, "You received 1000 M4a1 ammo!");
                    }
                    else
                    {//compile it on urs and send
                        SendClientMessage(playerid, COLOR_RED, "Only Cop, Army, Swat team could access this feature");
                     }

                }

                case 1:
                {
                    if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 179 || GetPlayerSkin(playerid) == 285)
                    {
                        GivePlayerWeapon(playerid, 32 , 1000);//1000 bullets to every wep
                        SendClientMessage(playerid, COLOR_BLUE, "You received 1000 Tec-9 ammo!");
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_RED, "Only Cop, Army, Swat team could access this feature");
                     }
                }

                case 2:
                {
                    if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 179 || GetPlayerSkin(playerid) == 285)
                    {
                        GivePlayerWeapon(playerid, 26 , 1000);//1000 bullets to every wep
                        SendClientMessage(playerid, COLOR_BLUE, "You received 1000 Sawnoff ammo!");
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_RED, "Only Cop, Army, Swat team could access this feature");
                     }
                }

                case 3:
                {
                    if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 179 || GetPlayerSkin(playerid) == 285)
                    {
                        GivePlayerWeapon(playerid, 24 , 1000);//1000 bullets to every wep
                        SendClientMessage(playerid, COLOR_BLUE, "You received 1000 Deagle ammo!");
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_RED, "Only Cop, Army, Swat team could access this feature");
                     }

                }

                case 4:
                {
                    if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 179 || GetPlayerSkin(playerid) == 285)
                    {
                        SetPlayerArmour(playerid, 100);
                        SendClientMessage(playerid, COLOR_BLUE, "You received an Armour!");
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_RED, "Only Cop, Army, Swat team could access this feature");
                     }
                }
                case 5:
                {
                    if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 179 || GetPlayerSkin(playerid) == 285)
                    {
                        GivePlayerWeapon(playerid, 34 , 1000);//1000 bullets to every wep
                        SendClientMessage(playerid, COLOR_BLUE, "You received 1000 Sniper ammo!");
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_RED, "Only Cop, Army, Swat team could access this feature");
                     }
                }
            }
        }
     }
    return 1;
}

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == Checkpoint)
    {
        ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, "Weapons", "M4a1\nTec-9\nSawnoff\nDeagle\nArmor\nSniper", "Select", "Leave");
    }
    return 1;
}
and you also have a tag mismatch

CreateDynamicCP(Float, Float:y, Float:z, Floatize, worldid = -1, interiorid = -1, playerid = -1, Floattreamdistance = 100.0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)