SA-MP Forums Archive
I tryed but didnt found it - 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: I tryed but didnt found it (/showthread.php?tid=363347)



I tryed but didnt found it - jeremy8810 - 27.07.2012

I got a rank system, but I dont want that NPC's gets the rank. I tryed somethings with IsPlayerNpc, but I got errors, maybe you guys now what to add?
Here my filterscript:
pawn Код:
public OnPlayerSpawn(playerid)
{
    new title[64];
    switch(GetPlayerScore(playerid)) {
        case 0..50:     format(title,sizeof(title),"Newbie Trucker");
        case 51..100:   format(title,sizeof(title),"Trucker in training");// Trucker in training
        case 101..200:  format(title,sizeof(title),"GoodTrucker"); // GoodTrucker
        case 201..500:  format(title,sizeof(title),"Junior Trucker"); // Junior Trucker
        case 501..1000: format(title,sizeof(title),"Senior Trucker");// Senior Trucker
        case 1001..1500:format(title,sizeof(title),"Trucker"); // Trucker
        case 1501..2000:format(title,sizeof(title),"Teansport Trucker"); // Transport Trucker
        case 2001..2500:format(title,sizeof(title),"Licensed Trucker"); // Licensed Trucker
        case 2501..3000:format(title,sizeof(title),"European Trucker"); // European Trucker
        case 3001..3500:format(title,sizeof(title),"World Trucker"); // "World Trucker"
        default:format(title,sizeof(title),"World European Trucker"); // World European Trucker
    }
    if(!LabelSet[playerid]) {
        label[playerid] = Create3DTextLabel(title,RED, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
        LabelSet[playerid] = true;
    } else {
        Delete3DTextLabel(label[playerid]);
        label[playerid] = Create3DTextLabel(title,RED, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
        LabelSet[playerid] = true;
    }
    return 1;
}



Re: I tryed but didnt found it - The__ - 27.07.2012

What exactly do you want ?


Re: I tryed but didnt found it - jeremy8810 - 27.07.2012

Quote:
Originally Posted by The__
Посмотреть сообщение
What exactly do you want ?
When NPC spawn's, it dont get a label on top of his head


Re: I tryed but didnt found it - TheDeath - 27.07.2012

pawn Код:
public OnPlayerSpawn(playerid)
{
if(!IsPlayerNPC(playerid)){
    new title[64];
    switch(GetPlayerScore(playerid)) {
        case 0..50:     format(title,sizeof(title),"Newbie Trucker");
        case 51..100:   format(title,sizeof(title),"Trucker in training");// Trucker in training
        case 101..200:  format(title,sizeof(title),"GoodTrucker"); // GoodTrucker
        case 201..500:  format(title,sizeof(title),"Junior Trucker"); // Junior Trucker
        case 501..1000: format(title,sizeof(title),"Senior Trucker");// Senior Trucker
        case 1001..1500:format(title,sizeof(title),"Trucker"); // Trucker
        case 1501..2000:format(title,sizeof(title),"Teansport Trucker"); // Transport Trucker
        case 2001..2500:format(title,sizeof(title),"Licensed Trucker"); // Licensed Trucker
        case 2501..3000:format(title,sizeof(title),"European Trucker"); // European Trucker
        case 3001..3500:format(title,sizeof(title),"World Trucker"); // "World Trucker"
        default:format(title,sizeof(title),"World European Trucker"); // World European Trucker
    }
    if(!LabelSet[playerid]) {
        label[playerid] = Create3DTextLabel(title,RED, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
        LabelSet[playerid] = true;
    } else {
        Delete3DTextLabel(label[playerid]);
        label[playerid] = Create3DTextLabel(title,RED, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
        LabelSet[playerid] = true;
    }
}
    return 1;
}