Police dispatch
#1

Hey i saw ur post and u look like u know a lot abput scriting. For a few days i have been struggling with a police dispatch .Here is my script
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new name[MAX_PLAYER_NAME],kname[MAX_PLAYER_NAME],weaponname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    GetPlayerName(killerid,kname,sizeof(kname));
    GetWeaponName(reason,weaponname,sizeof(weaponname));
    new wstring[128];
    if(!strcmp(name,kname,true)) {
    format(wstring, sizeof(wstring), "%s has died (Unknown).", name);
    } else {
    format(wstring, sizeof(wstring), "%s has killed %s (%s).", kname,name,weaponname);
    }
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    SendClientMessage(COLOR_DBLUE, wstring); <--------------------IDK why but it gives me a prob with this line here is the error
    }
ERRORC:\Users\Saurabh\Desktop\Saurabh\Server\gamem odes\underworld1.pwn(345 : error 035: argument type mismatch (argument 2)
Reply
#2

Try>>>> SendClientMessage(COLOR_DBLUE, "wstring");
Reply
#3

Quote:
Originally Posted by Austin_Lynn
Try>>>> SendClientMessage(COLOR_DBLUE, "wstring");
Thats wosre, your sending "wstring" not the string

pawn Код:
SendClientMessage(playerid, COLOR_DBLUE, wstring);
There you go

EDIT: i looked at your code, would this work better ?

pawn Код:
public OnPlayerDeath(playerid, killerid, reason) {
 new name[MAX_PLAYER_NAME],kname[MAX_PLAYER_NAME],weaponname[MAX_PLAYER_NAME];
 GetPlayerName(playerid,name,sizeof(name));
 GetPlayerName(killerid,kname,sizeof(kname));
 GetWeaponName(reason,weaponname,sizeof(weaponname));
 new wstring[128];
 if(!strcmp(name,kname,true)) {
  format(wstring, sizeof(wstring), "%s has died (Unknown).", name);
 } else {
  format(wstring, sizeof(wstring), "%s has killed %s (%s).", kname,name,weaponname);
 }
 for ( new i = 0; i < MAX_PLAYERS; i++ ) {
  if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1 || PlayerInfo[i][pMember] == 2 || PlayerInfo[i][pLeader] == 2) {
  SendClientMessage(i, COLOR_DBLUE, wstring); <--------------------no more error
  }
 }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)