Spawn name while spawning
#1

Hello
I made a script that says the name of the spawn location while you are spawning
Here are the Spawns:
pawn Код:
new PlayerSpawns[][5] {
{XXX,XXX,XXX,XXX,Los Santos},
{XXX,XXX,XXX,XXX,San Fierro},
{XXX,XXX,XXX,XXX,Las Venturas}
}
(Instead of the XXX there is a location,if there is XXX XXX its the name of the place,for example: Los Santos)

And I was putting this on OnPlayerSpawn:
pawn Код:
SendClientMessage(playerid,RED,"You have been spawned in %s",PlayerSpawns[randsp][5]);
But it doesn't work
Any ideas why?
Reply
#2

Mind showing us some more code, or the actual code?
Reply
#3

Quote:
Originally Posted by Krx17
Посмотреть сообщение
Mind showing us some more code, or the actual code?
This is the actuall code O.o
Reply
#4

Bump
Reply
#5

Quote:
Originally Posted by Montserrat
Посмотреть сообщение
Bump
I don't get your signature, it's serbian and israel flag? gz im serbian
Reply
#6

Quote:
Originally Posted by [JnA]DukeNukem
Посмотреть сообщение
I don't get your signature, it's serbian and israel flag? gz im serbian
www.flagcounter.com
Reply
#7

IsPlayerInRangeOfPoint should do the work

like
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, los, santos, spawn, 15))
    {
        SendClientMessage(playerid, COLOR, "You spawned in Los Santos");
    }
    if(IsPlayerInRangeOfPoint(playerid, san, fierro, spawn, 15))
    {
        SendClientMessage(playerid, COLOR, "You spawned in San fierro");
    }
    // And so on...
    return 1;
}
Replace these los, santos, spawn with X, Y and Z of thoose spawns, and replace the COLOR.
Reply
#8

Quote:
Originally Posted by Mean
Посмотреть сообщение
IsPlayerInRangeOfPoint should do the work

like
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, los, santos, spawn, 15))
    {
        SendClientMessage(playerid, COLOR, "You spawned in Los Santos");
    }
    if(IsPlayerInRangeOfPoint(playerid, san, fierro, spawn, 15))
    {
        SendClientMessage(playerid, COLOR, "You spawned in San fierro");
    }
    // And so on...
    return 1;
}
Replace these los, santos, spawn with X, Y and Z of thoose spawns, and replace the COLOR.
And what is the 15?
And where can I change the angle?

Quote:
Originally Posted by Mikkel_Pedersen
Посмотреть сообщение
When you're saying it doesn't work, do you mean that it compiles with errors, or that it shows something else in the chat in the server? I got an idea why it could be showing some numbers instead of the actual name, but I want to hear what exactly isn't working before replying with a possible helpful reply.
Its just doesn't do anything when I am typing /ls /sf /lv etc..
Reply
#9

Quote:
Originally Posted by Montserrat
Посмотреть сообщение
And what is the 15?
And where can I change the angle?



Its just doesn't do anything when I am typing /ls /sf /lv etc..
Well just noticed you did this:
pawn Код:
SendClientMessage(playerid,RED,"You have been spawned in %s",PlayerSpawns[randsp][5]);
Dunno if it would block the command, but: SendClientMessage can't format a message containing strings, you have to use "format" first, less you redefined SendClientMessage. Anyway it could be cause you didn't use format.

EDIT: Ryder showed how to do.
Reply
#10

Quote:
Originally Posted by Montserrat
Посмотреть сообщение
And what is the 15?
And where can I change the angle?



Its just doesn't do anything when I am typing /ls /sf /lv etc..
My bad, it's :
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 15, los, santos, spawn))
    {
        SendClientMessage(playerid, COLOR, "You spawned in Los Santos");
    }
    if(IsPlayerInRangeOfPoint(playerid, 15, san, fierro, spawn))
    {
        SendClientMessage(playerid, COLOR, "You spawned in San fierro");
    }
    // And so on...
    return 1;
}
+ This is called ONLY when you spawn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)