SA-MP Forums Archive
Problem With Npc's. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem With Npc's. (/showthread.php?tid=245921)



Problem With Npc's. - Manuwar - 02.04.2011

Why, with this script, change only botweap skin?
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerNPC(playerid))
    {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname));
    if(!strcmp(npcname, "botbus", true))
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0);
    }
    return 1;
    }
    PlayerPlaySound(playerid, 1186, 0.0, 0.0, 0.0);
    if(IsPlayerNPC(playerid))
    {
    new npc_name[24];
    GetPlayerName(playerid,npc_name,sizeof(npc_name));
    if(!strcmp(npc_name,"botweap",false))
    {
    SetPlayerSkin(playerid, 23);
    }
    return 1;
    }
    if(IsPlayerNPC(playerid))
    {
    new npc_name[24];
    GetPlayerName(playerid,npc_name,sizeof(npc_name));
    if(!strcmp(npc_name,"botweapon",false))
    {
    SetPlayerSkin(playerid, 30);
    }
    return 1;
    }
    return 1;
}



Re: Problem With Npc's. - -Rebel Son- - 02.04.2011

Код:
    if(!strcmp(npc_name,"botweapon",false))
to.....

Код:
    if(!strcmp(npc_name,"botweapon",true))
This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds. (THE FUCK?)